Ümit Uzun wrote:
As you said I hold different rotation Matrix for each Axis,

No, what I said was to keep each axis rotation angle in a separate variable, then construct the matrices from the two values.

float angleX( 0.f ), angleY( 0.f );

angleX += 10.f;
mt->setMatrix( osg::Matrix::rotate( around x ) *
    osg::Matrix::rotate( around y );

andleY += 10.f;
mt->setMatrix( osg::Matrix::rotate( around x ) *
    osg::Matrix::rotate( around y );

andleX -= 10.f;
mt->setMatrix( osg::Matrix::rotate( around x ) *
    osg::Matrix::rotate( around y );

andleY -= 10.f;
mt->setMatrix( osg::Matrix::rotate( around x ) *
    osg::Matrix::rotate( around y );

This still might not produce an exact identity matrix due to floating point roundoff errors, but it will be effectively identity. Rather that ask the matrix if it is identity, a faster and more accurate check would be to compare the angleX and angleY values against some epsilon near zero.
   -Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to