<p>You are correct, when they are talking about taking the inverse-transpose they are talking about the 3x3 part of the affine transformation leaving the translation since it doesn't affect the normal vector.</p>

<p>Check : <a href="https://en.wikipedia.org/wiki/Normal_(geometry)#Transforming_normals" rel="nofollow noreferrer">Normal / Transforming Normals | Wikipedia</a></p>

<p>About how or why is it the inverse transpose, a simple explanation, that is also given in the book "Essential Mathematics for Games" is</p>

<p>Suppose we have a Point $P$ and a normal vector $n$ both represented by column matrix. Then we know that
$$
n^T P = 0
$$
This is the same as the dot product.
Now if we apply a transformation matrix $M$ to point $P$, we'll have to apply some sort of transformation matrix $Q$ to $n$ also.
$$
\begin{eqnarray}
(Q n)^T M P &amp; = &amp; 0 \\
n^T Q^T M P &amp; = &amp; 0
\end{eqnarray}
$$</p>

<p>One solution is
$$
\begin{eqnarray}
Q^T M &amp; = &amp; I \\
Q &amp; = &amp; {M^{-1}}^T
\end{eqnarray}
$$
Hence the inverse transpose. This stands for any sort of transformation matrix $M$ be it scaling, rotation etc. Also for pure rotation matrix, since they are orthogonal, the matrix transforming the normals is the same as that of the vertices. as ${M^T}^T = M$</p>

CC BY-SA 3.0
2017-08-21T09:40:09.877Z
2018-03-03T20:07:34.817Z
2018-03-03T20:07:34.817Z
gallickgunner
<p>You're right, translation is not relevant in this context: it wouldn't affect the normals.</p>

<p>Consider a non-uniformly scaled object:</p>

<p><a href="https://i.sstatic.net/MET67.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/MET67.png" alt="enter image description here"></a></p>

<p>We want to get the normal matrix to transform the normals in the vertex buffer into vectors representing world space normals from the world matrix M, which encodes the translation, rotation and scaling (and shearing) of the model object.</p>

<hr>

<p>If you were to interpret the 3x3 of the M in the vertex shader, you would read rotation data with scaling applied. If the world matrix contains non-uniform scaling, your normal vectors will be scaled incorrectly, and you'll get the wrong results. </p>

<p>The reason we take the transpose of the transform is because the rotation matrix, used to create <code>M = TranslationMatrix x RotationMatrix x ScaleMatrix</code>, is an <a href="https://en.wikipedia.org/wiki/Orthogonal_matrix" rel="nofollow noreferrer">Orthagonal Matrix</a>, which means that the row vectors are <a href="https://en.wikipedia.org/wiki/Orthogonality" rel="nofollow noreferrer"><strong>orthogonal</strong></a>, <a href="https://en.wikipedia.org/wiki/Unit_vector" rel="nofollow noreferrer"><strong>unit</strong></a> vectors, i.e. they are linearly-independent and their length is one.</p>

<p>This type of matrices hold a property like the following:</p>

<pre><code>Q^T * Q = Q * Q^T = I
</code></pre>

<p>If you remember the inverse rule:</p>

<pre><code>Q^-1 * Q = Q * Q^-1 = I
</code></pre>

<p>This also means the following for the orthogonal matrices:</p>

<pre><code>Q^T = Q^-1
</code></pre>

<p>This allows us to apply the inverse of the rotations by transposing the matrix. </p>

<p>In summary, taking inverse-transpose of the world matrix does 2 important things:</p>

<ol>
<li>Undo transformation (Inverse)

<ul>
<li>undo the scaling (and shearing)</li>
<li>invert rotations</li>
<li>translate the object to the world center (irrelevant)</li>
</ul></li>
</ol>

<p><a href="https://i.sstatic.net/aeMoe.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/aeMoe.png" alt="enter image description here"></a></p>

<ol start="2">
<li>Un-undo rotations (Transpose)

<ul>
<li>Now, if we take the transpose of our matrix, we will get our rotations back to their original state because of the orthogonal property of the rotation matrix.</li>
</ul></li>
</ol>

<p><a href="https://i.sstatic.net/nmGHd.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/nmGHd.png" alt="enter image description here"></a></p>

<p>We now have our normal matrix ready to transform model-space normals defined in the vertex buffer into world-space normals in the vertex shader.</p>

CC BY-SA 3.0
2017-08-26T08:00:22.163Z
2017-08-26T08:00:22.163Z
Varaquilex
<p>For the past month, I have been learning on my own and writing a little graphics library and am currently working on the transformation of vertex normals to soon support lighting/shading. I understand how if I transform the vertices by a matrix <strong>M</strong> that I need to apply the inverse-transpose of M (i.e., (<strong>M</strong>^-1 )^T ) to the surface normals. However, I am struggling to understand how this "rule" can be applied to all of the basic transformations (translate, scale, rotate) ... particularly, translation.</p>

<p>Using a homogeneous (w) coordinate in a 4D vector class, a Translate(x, y, z) would have no effect on a normal since its w-coordinate is 0, indicating that it is a vector, not a point. However, when we transpose the inverse of the Translate then it would have an effect on the normal (which feels incorrect). </p>

<p>For example, let's say that we have created a 3D triangle and want to apply a basic Translate(1, 2, 3) to the three vertices' positions. Based upon the "rule" for transforming vertex normals (i.e., inverse-transpose), we should be multiplying the three vertices' normals by Transpose(Translate(-1, -2, -3)). However, this feels incorrect since a vertex normal should remain unaffected by Translation and only be affected by Rotation and Scaling. </p>

<p>Any help in understanding how the inverse-transpose can be applied to vertex normals would be greatly appreciated!</p>

<3d><transformations><matrix><normal-mapping>
Inverse-Transpose of Vertex Normals
user3394898
# Inverse-Transpose of Vertex Normals

(Asked by: username_0 on 2017-08-20)

For the past month, I have been learning on my own and writing a little graphics library and am currently working on the transformation of vertex normals to soon support lighting/shading. I understand how if I transform the vertices by a matrix **M** that I need to apply the inverse-transpose of M (i.e., (**M**^-1 )^T ) to the surface normals. However, I am struggling to understand how this "rule" can be applied to all of the basic transformations (translate, scale, rotate) ... particularly, translation.

Using a homogeneous (w) coordinate in a 4D vector class, a Translate(x, y, z) would have no effect on a normal since its w-coordinate is 0, indicating that it is a vector, not a point. However, when we transpose the inverse of the Translate then it would have an effect on the normal (which feels incorrect).

For example, let's say that we have created a 3D triangle and want to apply a basic Translate(1, 2, 3) to the three vertices' positions. Based upon the "rule" for transforming vertex normals (i.e., inverse-transpose), we should be multiplying the three vertices' normals by Transpose(Translate(-1, -2, -3)). However, this feels incorrect since a vertex normal should remain unaffected by Translation and only be affected by Rotation and Scaling.

Any help in understanding how the inverse-transpose can be applied to vertex normals would be greatly appreciated!

**Tags:** 3d, transformations, matrix, normal-mapping


---

## 2 answers

### Answer by username_1 on 2017-08-21. Score: 1

You are correct, when they are talking about taking the inverse-transpose they are talking about the 3x3 part of the affine transformation leaving the translation since it doesn't affect the normal vector.

Check : [Normal / Transforming Normals | Wikipedia](https://en.wikipedia.org/wiki/Normal_(geometry)#Transforming_normals)

About how or why is it the inverse transpose, a simple explanation, that is also given in the book "Essential Mathematics for Games" is

Suppose we have a Point $P$ and a normal vector $n$ both represented by column matrix. Then we know that
$$
n^T P = 0
$$
This is the same as the dot product.
Now if we apply a transformation matrix $M$ to point $P$, we'll have to apply some sort of transformation matrix $Q$ to $n$ also.
$$
\begin{eqnarray}
(Q n)^T M P & = & 0 \\
n^T Q^T M P & = & 0
\end{eqnarray}
$$

One solution is
$$
\begin{eqnarray}
Q^T M & = & I \\
Q & = & {M^{-1}}^T
\end{eqnarray}
$$
Hence the inverse transpose. This stands for any sort of transformation matrix $M$ be it scaling, rotation etc. Also for pure rotation matrix, since they are orthogonal, the matrix transforming the normals is the same as that of the vertices. as ${M^T}^T = M$


---

### Answer by username_2 on 2017-08-26. Score: 0

You're right, translation is not relevant in this context: it wouldn't affect the normals.

Consider a non-uniformly scaled object:

[![enter image description here](https://i.sstatic.net/MET67.png)](https://i.sstatic.net/MET67.png)

We want to get the normal matrix to transform the normals in the vertex buffer into vectors representing world space normals from the world matrix M, which encodes the translation, rotation and scaling (and shearing) of the model object.

---

If you were to interpret the 3x3 of the M in the vertex shader, you would read rotation data with scaling applied. If the world matrix contains non-uniform scaling, your normal vectors will be scaled incorrectly, and you'll get the wrong results.

The reason we take the transpose of the transform is because the rotation matrix, used to create `M = TranslationMatrix x RotationMatrix x ScaleMatrix`, is an [Orthagonal Matrix](https://en.wikipedia.org/wiki/Orthogonal_matrix), which means that the row vectors are [**orthogonal**](https://en.wikipedia.org/wiki/Orthogonality), [**unit**](https://en.wikipedia.org/wiki/Unit_vector) vectors, i.e. they are linearly-independent and their length is one.

This type of matrices hold a property like the following:

```
Q^T * Q = Q * Q^T = I

```

If you remember the inverse rule:

```
Q^-1 * Q = Q * Q^-1 = I

```

This also means the following for the orthogonal matrices:

```
Q^T = Q^-1

```

This allows us to apply the inverse of the rotations by transposing the matrix.

In summary, taking inverse-transpose of the world matrix does 2 important things:

1. Undo transformation (Inverse)
   * undo the scaling (and shearing)
   * invert rotations
   * translate the object to the world center (irrelevant)

[![enter image description here](https://i.sstatic.net/aeMoe.png)](https://i.sstatic.net/aeMoe.png)

2. Un-undo rotations (Transpose)
   * Now, if we take the transpose of our matrix, we will get our rotations back to their original state because of the orthogonal property of the rotation matrix.

[![enter image description here](https://i.sstatic.net/nmGHd.png)](https://i.sstatic.net/nmGHd.png)

We now have our normal matrix ready to transform model-space normals defined in the vertex buffer into world-space normals in the vertex shader.


---

