[osg-users] Mirror transformation
Gianluca Natale
natale at europe.altair.com
Wed Sep 13 10:24:30 PDT 2017
Happy to hear that it works.
BTW, actually the check is a bit more complicated, because you might want to apply mirroring against several axes in sequence.
Once you have the global transformation of the mirrored object, the correct check is the following.
Get the determinant of that global transformation, and check the sign:
- if < 0.0, it means that there is an odd number of negative scale factors in the matrix, so winding has to be reverted: set FrontFace mode to CLOCKWISE;
- if > 0.0, it means that there is no or an even number of negative scale factors, so winding has to be left as COUNTERCLOCKWISE.
Just for completeness.
Gianluca
-----Original Message-----
From: osg-users [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Ale Maro
Sent: Wednesday, September 13, 2017 7:12 PM
To: osg-users at lists.openscenegraph.org
Subject: Re: [osg-users] Mirror transformation
Hi Gianluca,
I tried your suggestion and it worked.
It is a little tricky for me becouse I need to analyze on the fly the transformation matrix and apply osg::FrontFace by consequence.... but it works.
Thank you.
Ale
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71712#71712
_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
More information about the osg-users
mailing list