If you run osgviewer on it with full optimization, the roof panels don't shade right because of the normals. If you turn off optimization by setting OSG_OPTIMIZER to NONE, then the normals are correct and it shades right. Or, if you apply the fix I suggested it behaves correctly too.
John
On 10/3/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
Hi John,
To transform planes and normals you mulitple by the transpose of the inverse of a matrix, to transform vertices you multiple by the matrix directly. The code you see does the trick of doing the transpose by doing doing switching the post and pre multiple order.
I also haven't see switching normal orientations before, this makes me wonder if there isn't something else wrong that you usage is uncovering. Could you provide a model that reproduces it?
Robert.
On 10/3/06, John Aughey < [EMAIL PROTECTED]> wrote:When the optimizer reduces static transforms, it multiplies the verticies and normals by the current transformation matrix. It uses TransformAttributeFunctor to do this. However, it's transforming the normals backwards. The comment in the TransformAttributeFunctor.cpp line 43 says to post mult by inverse for normals which makes no sense. The normals should be transformed the same way the verticies are. If you change the matrix from _im to _m on line 44, then the model optimizes correctly with the normals pointing the correct way._______________________________________________
If you want, I can submit a patch for just this.
John
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
