Hi, I want to set an object attitude (represented by a quaternion) using two parameters :
- a normal vector (to set rotation around X and Y axis) - a heading angle (rotation around non-transformed Z axis) I tried to set the attitude quaternion : 1/ using the normal vector : Code: osg::Vec3d myNormal(0.0, 1.0, 1.0); myNormal.normalize(); osg::Quat attitudeNormal; attitudeNormal.makeRotate(osg::Vec3d(0.0, 0.0, 1.0), myNormal) 2/ using the heading angle : Code: double heading = osg::PI_2; osg::Quat attitudeHeading; attitudeHeading.makeRotate(heading, osg::Vec3d(0.0, 0.0, 1.0)) But how can I combine the two parameters ? If I do : Code: attitude = attitudeHeading*attitudeNormal the normal constraint is no more valid because X and Y axis are transformed by the attitudeHeading and affect attitudeNormal If I do : Code: attitude = attitudeNormal*attitudeHeading the heading constraint s no more valid because Z is transformed by the attitudeNormal and affect attitudeHeading Did I miss something ? Thank you! Cheers, Aurelien ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46598#46598 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

