Re: [osg-users] Applying Rotation To An Object?

2010-04-26 Thread Robert Osfield
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
silcv...@googlemail.com 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
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

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


Re: [osg-users] Applying Rotation To An Object?

2010-04-26 Thread Elliot Pilkington
Thank you for your reply, Though i still cant get the code correct to make two 
rotations.

I just cant get any of the code combinations that I've tried to perform two 
rotations.

If anyone has any sample code which illustrates rotations it would be very much 
appreciated.

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





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


Re: [osg-users] Applying Rotation To An Object?

2010-04-26 Thread Tomlinson, Gordon
Hi I don't have code to hand but this old creator tutorial I put
together along time ago explains the concept of 2
PositionAttitudeTransform (DOF's)

http://www.vis-sim.com/creator/creator_dof1_ex_04.pdf


Gordon Tomlinson
Product Manager 3d Technology  Project Wyvern
Overwatch(r)
An Operating Unit of Textron Systems

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Elliot
Pilkington
Sent: Monday, April 26, 2010 7:25 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Applying Rotation To An Object?

Thank you for your reply, Though i still cant get the code correct to
make two rotations.

I just cant get any of the code combinations that I've tried to perform
two rotations.

If anyone has any sample code which illustrates rotations it would be
very much appreciated.

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





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