How does the transformation on a point affect the normal at that point?

654 Views Asked by At

Say I have a point in 3D with coordinates $\begin{bmatrix} p_1 \\ p_2 \\p_3 \end{bmatrix}$ and the normal on the point with coordinates $\begin{bmatrix} n_1 \\ n_2 \\n_3 \end{bmatrix}$. Now I apply a transformation on the point such that the resulting coordinates are $\begin{bmatrix} -0.16 p_1 \\ p_3+0.5 \\ 0.164 p_2 -0.025 \end{bmatrix}$. My question is that how will this transformation affect the normal at this point? Do I have to apply the same transformation for the normal as well?

2

There are 2 best solutions below

0
On BEST ANSWER

Say you have a plane $P$ described by a point $p$ on the plane and a normal vector $h$, i.e. $$ x \in P \Leftrightarrow (x - p)\cdot h = 0 \text{,} $$ and let $F$ be an invertible affine transform, meaning $$ Fx = Mx + c $$ for some invertible $3\times 3$ matrix $M$ and some vector $c$.

Now let's transform $P$ with $F$. Since $F$ is invertible and affine, we know that the result is going to be a plane again. Obviously, $p' = F(p) = Mp + c$ will lie in the transformed plane, so all we have to do is to find an $h'$ such that $$ y \in F(P) \Leftrightarrow (y - p')\cdot h' \overset\cdot = 0 \text{.} $$

To that end, we first observe that $y - p' = (Mx + c) - (Mp + c) = M(x-p)$, meaning we need to find an $h'$ such that $$ (y - p')\cdot h' = (\underbrace{M(x-p)}_{=y-p'})\cdot h' \overset\cdot = (x-p)\cdot h \text{.} $$ Since $(Au)\cdot v = u\cdot(A^T v)$, we can rewrite that requirement as $$ (M(x-p))\cdot h' = (x-p)\cdot \left(M^T h'\right) \overset\cdot = (x-p)\cdot h\text{,} $$ which is fullfilled if $M^T h' = h$, or in other words $h' = \left(M^T\right)^{-1} h$.

Therefore, if points are transformed with $$ F(x) = Mx + c $$ then normals are transformed with $$ \hat F(x) = \left(M^T\right)^{-1} x \text{.} $$

Note that $\left(M^T\right)^{-1} = \left(M^{-1}\right)^T$ for every invertible matrix $M$, i.e. the order in which we invert and transpose doesn't matter.

0
On

Tangent vectors can often be calculated by taking the difference between one vertex and another, and thus we would expect that a transformed tangent vector could be expressed as the difference between two transformed points. If M is a 3 × 3 matrix with which we transform a vertex position, then the same matrix M can be used to correctly transform the tangent vector at that vertex.

Since tangents and normals are perpendicular, the tangent vector T and the normal vector N associated with a vertex must satisfy the equation N ⋅ T = 0. We must also require that this equation be satisfied by the transformed tangent vector T′ and the transformed normal vector N′ . Given a transformation matrix M, we know that T′ = MT. We would like to find the transformation matrix G with which the vector N should be transformed so that N′ ⋅ T′ = ( GN ) ⋅ ( MT ) = 0. A little algebraic manipulation gives us

$$( GN ) ⋅ ( MT ) = ( GN )^T ( MT ) = N^T G^T MT .$$

Since $N^T T = 0$, the equation $N^T G^T MT = 0$ is satisfied if $G^T M = I$. We therefore conclude that $G = ( M^{−1} )^T$. This tells us that a normal vector is correctly trans- formed using the inverse transpose of the matrix used to transform points. Vec- tors that must be transformed in this way are called covariant vectors, and vec- tors that are transformed in the ordinary fashion using the matrix M (such as points and tangent vectors) are called contravariant vectors. If the matrix M is orthogonal, then $M^{−1} = M^T$ , and thus $( M^{−1} )^T= M$. There- fore, the inverse transpose operation required to transform normal vectors can be avoided when M is known to be orthogonal.

Also, note that normals and tangents are unaffected by translations.

in your case

$$P=\begin{bmatrix} p_1 \\ p_2 \\p_3 \end{bmatrix}$$

$$P'= M P+b $$

with $M=\left( \begin{array}{cc} -0.16 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 0.164 & 0 \\ \end{array} \right)$ and $b=\begin{bmatrix} 0 \\ 0.5 \\-0.025 \end{bmatrix}$

Therefore, the matrix you must use to transform your normals is $$G = ( M^{−1} )^T=\left( \begin{array}{ccc} -6.25 & 0. & 0. \\ 0. & 0. & 1. \\ 0. & 6.09756 & 0. \\ \end{array} \right)$$