Hi,

My scene graph looks like the image attached below:


Here, I want to rotate the geode1 along the axis normal of one of the vertices 
of geometry that attached to the geode2. Imagine that the normal at the 
vertex(0.0,0.0,0.0) of geode2 is (0.0,-1.0,0.0). i.e facing outwards from the 
screen.

I have done something like this:

osg::Matrix localToWorld = 
osg::computeLocalToWorld(geode2>getParentalNodePaths()[0] );
osg::Matrixd mat1,mat2;                                         
mat1.makeTranslate(osg::Vec3d(0.0,0.0,0.0) * localToWorld);
osg::Vec3 vec(osg::Vec3(0.0,-1.0,0.0) * localToWorld);
vec.normalize();                                                
mat2.makeRotate(osg::DegreesToRadians(45.f),vec);                               
                trans->setMatrix( mat1 * mat2);

But the rotation is happening in a weird way. 
Please let me know what could be the issue ?
Thank you!

Cheers,
Srinivas[/img]

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




Attachments: 
http://forum.openscenegraph.org//files/osgtransforms_142.png


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

Reply via email to