On 1/15/2011 8:21 PM, Jean-Sébastien Guay wrote:
Maybe I'm missing something, but aren't M*V and V*M already defined precisely to
help with multiplying by a matrix or its transpose? See the code for the Matrixf
and Matrixd classes, as well as this page:
Good...
The particular time when you'll do this would be when transforming normals and
planes by the inverse transpose. This is done all the time in the cull
traversal, where the inverse just happens to be the accumulated modelview
matrix.
Well, this doesn't appear to work for Plane:
osg::Plane p;
osg::Matrix4 l2w;
osg::Plane pprime = l2w * p; // compile error
I used this code instead:
p.transform( l2w );
This compiles, runs, and transforms the plane correctly.
Converting the plane to a Vec4 allows me to do this:
osg::Vec4 pv = p.asVec4();
osg::Vec4 pvprime = l2w * pv;
That code compiles and runs, but produces incorrect results when compared to the
(correct) results of osg::Plane::transform().
I'm on 2.8.3, so perhaps there have been improvements on trunk?
--
-Paul Martz Skew Matrix Software
http://www.skew-matrix.com/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org