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
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Sorry, I missed this reference in the wiki. I'll try to do better next time. I haven't got this working yet, but can't help but think this will be the right way to implement what I'm looking for.
Thank you!
Cheers,
Brian
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=34651#34651
Thank you!
Cheers,
Brian
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=34680#34680
NodeTrackerManipulator used to set it's distance relative to the node
being tracked, so what you describe is a regression that must have
been introduced when I merged a submission that re-factored the
manipulators to make them more flexible. I can't fix this right away
as I'm heads down on another task right now.
Robert.