instantreality forum
news: Welcome to the instantreality forums!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
January 19, 2018, 06:02:42 pm


Login with username, password and session length


Pages: [1] 2
  Print  
Author Topic: Nested Camera-View/Navigator  (Read 13261 times)
rbelow
Jr. Member
**
Posts: 53


View Profile
« on: April 08, 2008, 03:46:39 pm »

Hi,

is there a possibility to make a nested camera view? I have 2 rotations for a camera I want to add in some kind of way. The first one comes from a spacemouse which allows the user to turn around his own y-axis. also I have a SFRotation coming from a headtracking device. these rotation would be the movement of the head. with shapes I'd probably would use 2 nested transform nodes, and route the 2 rotations into them to rotate them. I'm looking for something similar which I can use with the navigator-node of the engine namespace. I appreciate any help.

Greets Robert
Logged
jbehr
Administrator
Full Member
*****
Posts: 155


View Profile
« Reply #1 on: April 08, 2008, 04:10:14 pm »

You can just use the Navigatior node in the scene as NavigationInfo or ViewBindable child.
Both have a MFNode 'navigator' field.

- As NavigationInfo-child it navigates the current bound ViewBindable.
- As ViewBindable-child it navigates the single (parent) ViewBindable.

Does this make sense for you ?

regards
johannes

Logged
rbelow
Jr. Member
**
Posts: 53


View Profile
« Reply #2 on: April 09, 2008, 01:09:44 pm »

No, not really  Huh. Does this mean that the rotation from the navigator
in navigationinfo and the one from the navigator in the interactionJob are added to one rotation ? And how can I add a child to viewbindable?? I would be glad about a short explanation to the mechanism you mentioned. So I can
figure it out for myself  Wink.

Greets
Robert
Logged
jbehr
Administrator
Full Member
*****
Posts: 155


View Profile
« Reply #3 on: April 09, 2008, 01:38:46 pm »

No, not really  Huh. Does this mean that the rotation from the navigator
in navigationinfo and the one from the navigator in the interactionJob are added to one rotation ?

Yes, if they are really in the same frame.

And how can I add a child to viewbindable?? I would be glad about a short explanation to the mechanism you mentioned. So I can
figure it out for myself  Wink.

Navigator child to ViewBindable (Viewpoint IS_A ViewBindable):

Viewpoint {
  navigator DEF nav Navigator { }
}

regards
johannes

Logged
rbelow
Jr. Member
**
Posts: 53


View Profile
« Reply #4 on: April 09, 2008, 01:45:40 pm »

AHH, ok. I'm beginning to understand. I'll try it and see how it works out for my case.

Thanks Robert
Logged
rbelow
Jr. Member
**
Posts: 53


View Profile
« Reply #5 on: April 28, 2008, 09:44:03 am »

Hello,

I've tried the solution Johannes posted, but it doesn't really seem to work.
I added a spacenavigator to the viewpoint (also tried navigationinfo), but as I route in the translation nothing happens. Means I notice no movement. Here's my code:

DEF view Viewpoint{
   description "First One"
   navigator DEF nav SpaceNavigator{}
}#viewpoint

ROUTE someSensor.translation TO nav.translation

Am I doing something wrong or is there maybe an error in the implementation.

Regards Robert

Logged
rbelow
Jr. Member
**
Posts: 53


View Profile
« Reply #6 on: May 06, 2008, 10:02:51 pm »

Anyone a solution??  Sad
Logged
pdaehne
Administrator
Sr. Member
*****
Posts: 250


View Profile
« Reply #7 on: May 08, 2008, 02:20:28 pm »

Hello Robert,

could you please explain more in detail what you're trying to do?

You mention some kind of head tracking. What exactly does that mean? Do you have a static projection wall (in this case you have to change the projection depending on the head position), or do you have an HMD (in which case you have to change the viewpoint depending on position and orientation).

Besides the head tracking, you want to move around in the scene using a spacemouse device. Is that correct?

Bye,

Patrick

Logged
rbelow
Jr. Member
**
Posts: 53


View Profile
« Reply #8 on: May 08, 2008, 02:33:25 pm »

Quote
could you please explain more in detail what you're trying to do?

Sure. I have a scene, where I move around using the spacemouse. In addition to that, I have a headtracking device which delivers the head position. what I want to do is, that the user can change his viewposition by moving his head according to the position made by the spacemouse. So the headmovement is relative to the current position of the user, so that he can move 1m to the side or so from the position he navigated to.

Quote
Besides the head tracking, you want to move around in the scene using a spacemouse device. Is that correct?
Exactly. The user stands in front of a wall and moves with the spacemouse, as well as make relative movement with the head bind to his current position.

Greetings
Robert
Logged
pdaehne
Administrator
Sr. Member
*****
Posts: 250


View Profile
« Reply #9 on: May 08, 2008, 03:07:23 pm »

Just for clarification: You have a projection wall, not a HMD? (I have to ask because that makes a difference.)

Logged
rbelow
Jr. Member
**
Posts: 53


View Profile
« Reply #10 on: May 08, 2008, 04:18:16 pm »

Yes. I have a projection. The user just has a hat with a marker to track his
position.
Logged
pdaehne
Administrator
Sr. Member
*****
Posts: 250


View Profile
« Reply #11 on: May 09, 2008, 11:10:23 am »

Ok. You have to connect the Spacemouse to a navigator as Johannes explained. For the head tracking, you have to modify your engine file.

I presume that you already have set up an engine file for your projection screen - otherwise have a look at the tutorial section on this web page. In your engine, you'll have some Viewport nodes like this:

Code:
            # left left eye
            DEF leftLefteye Viewport {
               logoEnabled FALSE
               modifier [
                DEF modifierLeftLeft ProjectionViewModifier {
                   surface [
                      -1.6827 -0.520 0.9857
                      -0.697 -0.520 0
                      -0.697 0.520 0
                      -1.6827 0 0.9857
                   ]
                   leftEye  TRUE
                   rightEye FALSE
                   eyeSeparation 0.05
                }
               ]
            }

Then, you need the position of the head. On our wall, we get the position via a SFVec3fSensor from the devicemanagement system:

Code:
DEF headPos SFVec3fSensor {
  label "headPos"
  description "Head Position"
}

Then, we transform the position vector into a transformation matrix by using a MatrixComposer node:

Code:
DEF eyeComposer MatrixComposer {
  translation 0 0 1.682
}

ROUTE headPos.value_changed TO eyeComposer.set_translation

The translation given in the MatrixComposer is the default position, i.e. the position that is used when there is no tracking system connected.

Finally, we route the transformation matrix into all ProjectionViewModifier nodes under the Viewport nodes:

Code:
ROUTE eyeComposer.matrix_changed TO modifierLeftLeft.set_eyeTransform
...

Hope that helps,

Patrick
Logged
rbelow
Jr. Member
**
Posts: 53


View Profile
« Reply #12 on: May 09, 2008, 11:32:05 am »

Hello Patrick,

thanks for the help. I try it the next days, and let you know if it works.

Greetings
Robert
Logged
rbelow
Jr. Member
**
Posts: 53


View Profile
« Reply #13 on: May 15, 2008, 12:41:04 pm »

Hello Patrick,

your solution works fine. Thanks again for the help. But I have one more little question. Why does it only work, when I route the matrix to all Projectionmodifiers? In the beginning I've only routed it to one and nothing happened? just when I routed it to all modifiers, the changes took place.

Regards
Robert
 
Logged
pdaehne
Administrator
Sr. Member
*****
Posts: 250


View Profile
« Reply #14 on: May 15, 2008, 01:54:48 pm »

When you route the matrix just to one ProjectionModifier, it only transforms one eye (left or right) on one single tile of your projection screen. You probably simply did not realize the change...

Anyway, it is good that you've been able to solve the problem.

Bye,

Patrick

Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by SMF 1.1.15 | SMF © 2011, Simple Machines