Miles Bader
2007-12-16 02:52:19 UTC
Hi,
When transforming a normal vector (e.g. if you calculate the
intersection normal in object space , and subsequently transform it to
world space), you need to use the tranpose of the inverse of the nominal
transformation matrix:
N' = N * transpose (invers (M))
[and then re-normalize the normal after transformation]
So, how does one normally transform tangent vectors (which together with
the normal form an orthonormal basis)?
It seems that for _one_ of the tangent vectors, you could just use the
nominal transformation matrix, and it will remain perpendicular to the
normal after transformation.
However, what about the _other_ tangent vector (in 3d)? If one uses the
nominal transformation matrix, it also would remain perpendicular to the
normal after transformation, but it looks to me like it might _not_ end
up being perpendicular to the first tangent vector.
I suppose one could just recompute it as the cross product of the other
two transformed vectors:
N' = N * transpose (invers (M))
T1' = T1 * M
T2' = N' x T1'
but i'm not sure I really like this as it makes one tangent vector more
special than the other (which might matter, for instance if the tangent
vectors have some defined relationship to the geometry of the underlying
object)...
Thanks,
-Miles
When transforming a normal vector (e.g. if you calculate the
intersection normal in object space , and subsequently transform it to
world space), you need to use the tranpose of the inverse of the nominal
transformation matrix:
N' = N * transpose (invers (M))
[and then re-normalize the normal after transformation]
So, how does one normally transform tangent vectors (which together with
the normal form an orthonormal basis)?
It seems that for _one_ of the tangent vectors, you could just use the
nominal transformation matrix, and it will remain perpendicular to the
normal after transformation.
However, what about the _other_ tangent vector (in 3d)? If one uses the
nominal transformation matrix, it also would remain perpendicular to the
normal after transformation, but it looks to me like it might _not_ end
up being perpendicular to the first tangent vector.
I suppose one could just recompute it as the cross product of the other
two transformed vectors:
N' = N * transpose (invers (M))
T1' = T1 * M
T2' = N' x T1'
but i'm not sure I really like this as it makes one tangent vector more
special than the other (which might matter, for instance if the tangent
vectors have some defined relationship to the geometry of the underlying
object)...
Thanks,
-Miles
--
o The existentialist, not having a pillow, goes everywhere with the book by
Sullivan, _I am going to spit on your graves_.
o The existentialist, not having a pillow, goes everywhere with the book by
Sullivan, _I am going to spit on your graves_.