Hi Paul,
So my original code must have been flawed.
Just curious, trying to get to the bottom of this in case it's
important... The code you first posted used Plane::asVec4(), and your
new code doesn't. Could it be that p.asVec4() != v? i.e. there would be
a bug in Plane::asVec4()?
{
osg::Vec4 v( 1.0, 0.0, 0.0, 1.0 );
osg::Matrix m( osg::Matrix::translate( 3., 5., 0. ) );
osg::Plane p( v );
p.transform( m ); // multiply by inverse transpose
osg::notify( osg::NOTICE ) << p << std::endl;
osg::Matrix mInv = osg::Matrix::inverse( m );
osg::Vec4 vPrime = mInv * v; // multiply by inverse transpose
osg::notify( osg::NOTICE ) << vPrime << std::endl;
osg::Vec4 vPrime2 = mInv * p.asVec4(); // multiply by inverse
transpose
osg::notify( osg::NOTICE ) << vPrime2 << std::endl;
assert(v == p.asVec4());
assert(vPrime == vPrime2);
}
J-S
--
______________________________________________________
Jean-Sebastien Guay [email protected]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org