it will not work since you are overriding the position. Can you share your
code so I can compile .. This is simple and I have to look into
PositionAttitudeTransform. With matrices you can do it too.

Once your matrix is ready you can do something like
heliceTranf->setPosition(mx.getTranslate();
heliceTrans->setAttitude(mx.getRotate)

where mx is Matrixd and constructed as is my previous email, like:

Matrixd mx;
Matrixd translate1 = Matrixd::translate(-Vec3(x,y,z));
Matrix rotate = Marixd::rotate(q/*your quaternion*/);
Matrix translate2 = Matrixd::translate(Vec3(x,y,z));

mx = translate1 * rotate * translate2;

Send me your code I will look at Something I can compile fast :-)

Nick


On Wed, May 14, 2014 at 9:13 PM, Tiago Martins <[email protected]>wrote:

> Thanks Nikolov, I tried something as you suggested..
>
>
> Code:
> osg::PositionAttitudeTransform* heliceTransf =
> static_cast<osg::PositionAttitudeTransform*>(node);
>
>                 heliceTransf->setPosition(-osg::Vec3(0,-100,10));
>
>
>
>                 osg::Quat q = heliceTransf->getAttitude();
>                 q *= osg::Quat(0.0, osg::Y_AXIS, 0.0, osg::X_AXIS, 0.05,
> osg::Z_AXIS);
>                 heliceTransf->setAttitude(q);
>
>
>
>                 heliceTransf->setPosition(osg::Vec3(0,-100,10));
>
>
>
> But still is not rotating around its center..
>
> And I can't use the as you suggested using the Matrix, because the
> rotation must be placed at the node object as using the "setAttitude"
> method..
>
> Thanks alot again, can you see what is happening ?
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=59411#59411
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to