Re: [osg-users] How do I set NodeTrackerManipulator to rotate with the nodes?

2021-01-05 Thread Alberto Luaces
Did you try NODE_CENTER_AND_ROTATION ?

-- 
Alberto

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How do I set NodeTrackerManipulator to rotate with the nodes?

2021-01-03 Thread mirr...@gmail.com
W10 gtx3.x OSG3.6.4

 osgGA::NodeTrackerManipulator::TrackerMode trackerMode = 
osgGA::NodeTrackerManipulator::NODE_CENTER_AND_AZIM;

  osgGA::NodeTrackerManipulator::RotationMode rotationMode = 
osgGA::NodeTrackerManipulator::TRACKBALL;


osg::ref_ptr glider = osgDB::readRefNodeFile("glider.osgt");
if (glider)
{
const osg::BoundingSphere& bs = glider->getBound();

float size = radius/bs.radius()*0.3f;
osg::MatrixTransform* positioned = new osg::MatrixTransform;
positioned->setDataVariance(osg::Object::STATIC);
positioned  ->setMatrix(osg::Matrix::translate(-bs.center())*
 osg::Matrix::scale(size,size,size)*

 osg::Matrix::rotate(osg::inDegrees(-90.0f),0.0f,0.0f,1.0f));

positioned->addChild(glider);

osg::PositionAttitudeTransform* xform = new 
osg::PositionAttitudeTransform;
xform->setUpdateCallback(new 
osg::AnimationPathCallback(animationPath,0.0,1.0));
xform->addChild(positioned);

*  osgGA::NodeTrackerManipulator* tm = new 
osgGA::NodeTrackerManipulator;*
*  tm->setTrackerMode( trackerMode );*
*  tm->setRotationMode( rotationMode );*
*  tm->setTrackNode( xform );*
*  viewer.setCameraManipulator(tm);*
 }

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/7bb98730-bb2d-4f98-ae68-4a70ef9d9c1cn%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org