Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transforming surface normal vectors and tangent vectors

Tags:

math

opengl

3d

According to a book Physically Based Rendering: From Theory to Implementation. By Matt Pharr, Greg Humphreys (link, p. 86-87),
surface tangent vectors are transformed as common vectors, using transformation matrix M, but
surface normal vectors are transformed using enter image description here.

I wonder why scaling does make a normal incorrect, but doesn't touch a tangent vector? Why are normals so special?

See the figure from the book. enter image description here

I have read that such transformation for normal is needed to maintain orthogonality of the normal and tangent. But I'd like to get some intuitive explanation.

like image 360
Temak Avatar asked Oct 20 '22 10:10

Temak


1 Answers

For me, the intuition would be that for rotations (and in general all transformation that can be described by an orthogonal matrix) satisfy formula. That means that enter image description here, so for those kinds of transformations the treatment is not special at all.

A simple example with a non-orthogonal, symmetric matrix that illustrates that it is not sufficient to use enter image description here to transform the normal is

enter image description here

Here see that you need to transform the normal using enter image description here, which in the symmetric case is equal to enter image description here.

Notice that this covers already quite a lot of transformations. Personally, I find that transformations that are not orthogonal and not symmetric are themselves not very intuitive, so I resort to the mathematical explanation that it is required to maintain orthogonality. Since this is the defining property of a surface normal I find this argument quite plausible. Maybe writing it out makes things a bit clearer:

enter image description here

So the advantage of the transformation rule from the book is that it gives you the right normal for all transformation you can think of.

Hope this helps.

like image 175
spfrnd Avatar answered Oct 28 '22 16:10

spfrnd