Hi,

I'm working on an application where the initial scene is scene is very large. 
However, as the user adds smaller objects to the scene I want the camera to be 
able to follow the objects. I'd like to be able to center the manipulator on an 
object and follow the object along a path.

I'm trying to use the orbitalManipulator's setTransformation function to do 
this by calculating an eye vector (based on a North East Down offset from the 
center and rotation back to X,Y,Z), a center (the object's position), and an up 
vector (the unit vector of the object's position). I can run the model and 
printout what appear to be valid vectors for the eye, center, and up, but the 
camera appears to be looking at my object from the wrong direction. 

Does my approach seem logical, and is there some obvious coordinate conversion 
that I'm not doing to go between global (x,y,z -model coordinates) to viewing 
(cameraManipulator) coordinates?

ViewerQT* canvas;

canvas->getCameraManipulator()->setTransformation(eye, center, up);

Thank you!

Cheers,
Brian

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=34638#34638





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to