PDA

View Full Version : Normal based Rotation


JokerMartini
07-21-2011, 02:23 PM
So is there a way to setup a rotation script to have an object follow the normal of a polygon or vertex?

Bobo
07-21-2011, 03:16 PM
So is there a way to setup a rotation script to have an object follow the normal of a polygon or vertex?

A normal does not describe an orientation completely. While you can orient one axis of an object to it, the other two axes have unlimited number of possible orientations. You could use the matrixFromNormal() method and extract the .rotationpart, but the X and Y would be, while not arbitrary, less explicitly defined. If that does not satisfy your needs, you would have to build your own matrix using an up vector and the normal. There was another post a couple of days ago about this:
http://forums.cgsociety.org/showthread.php?f=98&t=993062

CGTalk Moderation
07-21-2011, 03:16 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.