<p>Yes, all vectors used for lighting need to be in the same coordinates. If you do lighting in eye space, the normals would need to be transformed to eye space as well. Lighting calculations can also be done in world space, or any other space that's convenient.</p>

<p>You're right that normal vectors shouldn't receive translation; likewise other vectors that represent directions or displacements rather than points in space. If you represent transformations as 4×4 matrices, it's simple to skip the translation by just leaving off the last column.</p>

<p>Also, one subtlety that comes up is that if your transformations contain non-uniform scaling (different scale factors along different axes) or shear, then you need to use the <strong>inverse transpose</strong> matrix for normals. This is to ensure that the normals stay perpendicular to the polygons. (The inverse transpose will be the same as the original matrix if neither scaling nor shearing is present.)</p>

CC BY-SA 3.0
2018-02-22T21:35:22.653Z
2018-02-22T21:35:22.653Z
Nathan Reed
<p>Obj files give pre-calculated normals which are in model coordinates. So I wonder if they have to be transformed into eye coordinate (where I use them to calculate lighting)? I'm thinking yes because it makes sense, but only rotation and scale because translation doesnt really make sense for free vectors.</p>

<3d><transformations>
Do normals in obj files have to be changed into eye coordinate before being used?
Manh Nguyen Huu
# Do normals in obj files have to be changed into eye coordinate before being used?

(Asked by: username_0 on 2018-02-22)

Obj files give pre-calculated normals which are in model coordinates. So I wonder if they have to be transformed into eye coordinate (where I use them to calculate lighting)? I'm thinking yes because it makes sense, but only rotation and scale because translation doesnt really make sense for free vectors.

**Tags:** 3d, transformations


---

## 1 answers

### Answer by username_1 on 2018-02-22. Score: 2

Yes, all vectors used for lighting need to be in the same coordinates. If you do lighting in eye space, the normals would need to be transformed to eye space as well. Lighting calculations can also be done in world space, or any other space that's convenient.

You're right that normal vectors shouldn't receive translation; likewise other vectors that represent directions or displacements rather than points in space. If you represent transformations as 4×4 matrices, it's simple to skip the translation by just leaving off the last column.

Also, one subtlety that comes up is that if your transformations contain non-uniform scaling (different scale factors along different axes) or shear, then you need to use the **inverse transpose** matrix for normals. This is to ensure that the normals stay perpendicular to the polygons. (The inverse transpose will be the same as the original matrix if neither scaling nor shearing is present.)


---

