PDA

View Full Version : normal-transformation



groovy_mace
08-12-2002, 02:44 AM
Hi!
I'm trying to comprehend a little about how OpenGL works, i.e. about matrices and stuff. Now I've read something in a OpenGL-book, that I don't understand at all:

To make sure that the normals stay perpendicular to the polygons, they must not be transformed with the same Matrix like the points, but with the transposed of the inverse of the transformation-matrix.

What makes the normal different to any other point?

thanks,

groovy_mace

Relic
08-12-2002, 03:01 AM
Normals have a direction and a length.
Draw a circle with some nice normals pointing to the outside. Now squish the circle to an ellipse, aka. non-uniform scale.
How do you transform the normals to get them pointing away from the ellipse in a 90 degree angle from their footpoint's tangent to the ellipse? There you are, transposed inverse of the scale.


[This message has been edited by Relic (edited 08-12-2002).]

davepermen
08-12-2002, 03:44 AM
if you take the transpose, translation doesn't affect the normals

if you take the transpose inverse, rotations stay the same

if you take the inverse, scaling inverses

if you take the transpose inverse, scaling inverses,rotations stays the same,and translation doesn't affect the normal.

the translation and rotational part makes sence from the first view (no trans, and rotation stays the same), the scaling, as suggested, look at the squished sphere, wich got an elipse. you have to scale by the inverse..

somewhere i've seen a paper explaining this all visually..

groovy_mace
08-13-2002, 01:34 AM
Hi,
thanks a lot, I understand now, that I cannot transform normals like the other points.
But if someone knows a site explaining the use of those kinds of matrices, I'd be glad to know.
I still know how to determine inverse, transpose, isotropic and anything about matrices, but I don't know what they are good for...

Thanks a lot,
groovy_mace

Relic
08-13-2002, 05:04 AM
The OpenGL Programming Guide explains the matrix and trasformation basics in appendix F. "Transforming normals" takes a good piece of that appendix, more than "transforming vertices". http://www.opengl.org/discussion_boards/ubb/smile.gif
Search for "redbook.pdf" and download it.

cass
08-13-2002, 07:02 AM
groovy_mace,

I think Eric Lengyel has a really nice description of this in his book Mathematics for 3D Game Programming and Computer Graphics - which you can find at this link:
http://search.barnesandnoble.com/booksearch/isbnInquiry.asp?userid=0F4U8OX7Y5&isbn=1584500379

I also have a different description (less mathematically rigorous) of normal transformation from GDC 2001 that you can find at:
http://developer.nvidia.com/view.asp?IO=gdc2001_perpixellighting

Hope this helps -
Cass