I am trying to use FlyNavigator to navigate through a large scene,
but I have a few confusions about how it works. I set up the
FlyNavigator as follows:
mNavigator.setFrom(OSG::Pnt3f(0,0,0));
mNavigator.setAt(OSG::Pnt3f(0,0,-1));
mNavigator.setUp(OSG::Vec3f(0,1,0));
This would make me look down the z-axis. Now, I do the following before
drawing my frame:
if (key_evt->getKey() == gadget::KEY_UP)
mNavigator.forward(10.0f);
else if (key_evt->getKey() == gadget::KEY_DOWN)
mNavigator.forward(-10.0f);
else if (key_evt->getKey() == gadget::KEY_RIGHT)
mNavigator.rotate(0.1, 0);
else if (key_evt->getKey() == gadget::KEY_LEFT)
mNavigator.rotate(-0.1, 0);
I assumed that mNavigator.forward(val) would move you forward in the
direction you were facing, but it seems it moves me in a large radial
around the origin where, consequent rotations would just move me around
the radial and forward would make the radial larger. How would I use
the fly navigator to accomplish flying through a scene, where forward
would always be the direction the current navigator is facing and
rotations would be around the current view's x/y axes?
Thanks,
Alan
--
------------------------------------------------
Alan Austin Cell 515-708-2851
Computer Science Liberal Arts and Science
Beijing Project - VRAC - ISU
[EMAIL PROTECTED]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users