Thanks for pointing me toward the PositonAttidudeTransform class.

Below is what im trying:

Code:

MatrixTransform *rotate_planetFive = new MatrixTransform;
   rotate_planetFive->addChild( geode_planetFive );
   rotate_planetFive->setUpdateCallback( new 
AnimationPathCallback(osg::Vec3(2.0f, 0.0f, 0.0f), osg::Z_AXIS, 
inDegrees(-300.0f)) );

        PositionAttitudeTransform *trans_planetFive = new 
PositionAttitudeTransform;
        rotate_planetFive->addChild( geode_planetFive );
        rotate_planetFive->setUpdateCallback( new 
AnimationPathCallback(osg::Vec3(0.0f, 0.0f, 0.0f), osg::Z_AXIS, 
inDegrees(25.0f)) );




The MatrixTransform makes the object spin on its own axis and then the 
PositionAttitudeTransform makes the object orbit around a central point. 

When i run each part separately, they work fine but now i need them to do both 
at the same time, ands the problem. I add them to my scene like this:

Code:

simpleGroup->addChild(trans_planetFive);
simpleGroup->addChild(rotate_planetFive);




But they cannot work together at the same time.

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





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

Reply via email to