Hi Eillot,

You either need to write your own callback to update the
PossitionAttitudeTransform's rotation directly yourself, composing the
two rotation using the osg::Quat class, or use two seperate transforms
arranged in a parent child relationship.

Robert.

On Mon, Apr 26, 2010 at 3:51 AM, Elliot Pilkington
<[email protected]> wrote:
> Having created a sphere and applying a texture and lighting i now need to 
> apply a rotation to my sphere, i have done this by using an animate callback.
>
>
> Code:
>
> PositionAttitudeTransform *rotate_plntOne = new PositionAttitudeTransform;
> rotate_plntOne->addChild(geode_planetOne);
> rotate_plntOne->setUpdateCallback( new AnimationPathCallback(osg::Vec3(0, 0, 
> 0), osg::Z_AXIS, inDegrees(50.0f)) );
>
>
>
> This was fine for what I needed but I now need to apply two rotations, one 
> around its own axis whilst it also around another point, Imagine a planet for 
> example.
>
> I searched the forums and have seen people using the 
> PositionAttitudeTransforms and would like some help with this, I just cant 
> seem to get my code to work.
>
> I was just wondering, could someone show me the code for applying two 
> rotations to an object because i am really stumped and dont think im going to 
> work this one out any time soon, embarrassingly.
>
> Any help would be much appreciated!
>
> Thank You.
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=27266#27266
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to