[osg-users] Camera Positioning with a Node Tracker Manip.

Rusty Shackleford brianboyle.it at gmail.com
Sun Apr 24 17:59:26 PDT 2011


I'm using a NodeTrackerManipulator to lock the camera's motion around a model in space. This code below is all I have now:


Code:

camTracker = new osgGA::NodeTrackerManipulator();
camTracker->setTrackNode(someNode);
camTracker->setMinimumDistance(30.0f);
camTracker->setDistance(100.0f);
camTracker->setTrackerMode(osgGA::NodeTrackerManipulator::NODE_CENTER);

viewer->setCameraManipulator(camTracker);




When the app loads, the camera seems to be positioned along the Y axis, facing the node, about 100 units behind it along the Y. How can I change this initial angle? Ideally, I'd like the camera to be positioned on the opposite end of the node and above it such that it's viewing it from a 45-degree angle.

I also have it so that the tracked node is changed at the user's command, and would like to have different starting positions for each of the possible tracked nodes. Is there a way I can set the tracked node, then move the camera to a custom initial position relative to the node?


Thank you!

Cheers,
Rusty[/code]

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








More information about the osg-users mailing list