On 15.02.2012 22:48, Scott Wasinger wrote:
Just for some clarification are you trying to make a camera that follows your
car model? Because I had the similar issue recently and through my research I
found I could attach a camera manipulator to a node and the camera will be
translated relative to the position of the PositionAttitudeTransform.
*Note I needed to attach the manipulator to a child of the
PositionAttitudeTransform. In your case it would be the Node that you loaded
the model file.
Code:
osg::ref_ptr<osgGA::NodeTrackerManipulator> manipulator = new
osgGA::NodeTrackerManipulator;
manipulator->setTrackerMode(osgGA::NodeTrackerManipulator::NODE_CENTER);
manipulator->setRotationMode(osgGA::NodeTrackerManipulator::TRACKBALL);
osg::ref_ptr<osg::PositionAttitudeTransform> vehicleRoot =
dynamic_cast<osg::PositionAttitudeTransform *>(node);
if(vehicleRoot.valid())
{
manipulator->setTrackNode(vehicleRoot.getTrackerNode());
}
Hopefully this helps with your what your trying to accomplish
Scott[/code]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45496#45496
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Thanks, that's great! But I have one more problem. How can I change
distance of manipulator? I mean it is connected with node, but it's far
away. I want to zoom in. And also I don't know how to turn off mouse
controll...
--
Maciej Ciemborowicz
http://ciemborowicz.pl
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org