<p>It is common for modeling software to compute the normals when they aren't included in the loaded file (regardless of the format). This is usually highly dependent on the settings chosen when the file is loaded. Vertex normals can be computed fairly easily. The software can also compute smooth or faceted normals so you can switch between the two.</p>
<p>Your example includes faces...the <code>f 3 2 1</code> is a face. Each number refers to  one of the vertex values which are numbered starting from the top. <code>v -2.22045e-16 -0.291306 -2.22045e-16</code> is vertex number 1 in this case. The software can easily use that information to compute normals.</p>
<p>A normal is computed from the cross product of the edge vectors. Stictly speaking the obj format doesn't compute the actual normals, it just provides the information that Meshlab needs so that Meshlab can compute the normals. which looks something along the lines of:</p>
<p><code>facted_normal = normalize( cross( 2-3, 1-3))</code></p>
<p>Where the numbers for 1, 2 and 3 are replaced with the actual values for those vertices. Other types of normals are usually computed based of that.</p>
<p>I loaded this file into Blender and it is well behaved, so odds are meshlab has some options turned on that are showing split normals or vertex normals or one of the many other possible variants out there.</p>

CC BY-SA 4.0
2021-03-21T13:30:40.087Z
2021-03-21T15:05:23.017Z
2021-03-21T15:05:23.017Z
pmw1234
<blockquote>
<p>Why does this happen?</p>
</blockquote>
<p>If no normals are supplied, meshlab probably generates them. This is common behaviour of many 3D applications.</p>
<p>There are various techniques for generating normals (per-vertex, per-face, weighted, non-weighted etc) depending on the desired appearance (smooth/flat shading).</p>
<blockquote>
<p>(and some normals not attached to vertices).</p>
</blockquote>
<p>Sound possibly like a bug on meshlab's part. Can you post a screen-shot?</p>

CC BY-SA 4.0
2021-03-21T13:35:41.080Z
oops we got the same basic answer at almost the same moment haha
pmw1234
CC BY-SA 4.0
2021-03-21T13:45:09.993Z
@pmw1234 Indeed, I feel you may have ninja'd me slightly by a min ;)
lfgtm
CC BY-SA 4.0
2021-03-21T13:32:14.083Z
2021-03-21T13:32:14.083Z
lfgtm
<p>I have a very simple obj file:</p>
<pre><code>v -2.22045e-16 -0.291306 -2.22045e-16
v -0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 -2.22045e-16 -0.24339
v -2.22045e-16 -2.22045e-16 -0.24339
v 0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 -0.291306 -2.22045e-16
v -2.22045e-16 -2.22045e-16 -0.24339
v -0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 0.291306 -2.22045e-16
v -2.22045e-16 -2.22045e-16 -0.24339
v -2.22045e-16 0.291306 -2.22045e-16
v 0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 -0.291306 -2.22045e-16
v -2.22045e-16 -2.22045e-16 0.24339
v -0.24339 -2.22045e-16 -2.22045e-16
v 0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 -2.22045e-16 0.24339
v -2.22045e-16 -0.291306 -2.22045e-16
v -0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 -2.22045e-16 0.24339
v -2.22045e-16 0.291306 -2.22045e-16
v 0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 0.291306 -2.22045e-16
v -2.22045e-16 -2.22045e-16 0.24339
f 3 2 1
f 6 5 4
f 9 8 7
f 12 11 10
f 15 14 13
f 18 17 16
f 21 20 19
f 24 23 22
</code></pre>
<p>As you can see, there is no <code>vn</code> command. However, if I open it in meshlab and turn on the vertex normal rendering, it shows vertex normals (and some normals not attached to vertices).</p>
<p>Why does this happen?</p>

<3d>
How does OBJ format determine vertex normals?
trisct
# How does OBJ format determine vertex normals?

(Asked by: username_0 on 2021-03-21)

I have a very simple obj file:

```
v -2.22045e-16 -0.291306 -2.22045e-16
v -0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 -2.22045e-16 -0.24339
v -2.22045e-16 -2.22045e-16 -0.24339
v 0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 -0.291306 -2.22045e-16
v -2.22045e-16 -2.22045e-16 -0.24339
v -0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 0.291306 -2.22045e-16
v -2.22045e-16 -2.22045e-16 -0.24339
v -2.22045e-16 0.291306 -2.22045e-16
v 0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 -0.291306 -2.22045e-16
v -2.22045e-16 -2.22045e-16 0.24339
v -0.24339 -2.22045e-16 -2.22045e-16
v 0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 -2.22045e-16 0.24339
v -2.22045e-16 -0.291306 -2.22045e-16
v -0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 -2.22045e-16 0.24339
v -2.22045e-16 0.291306 -2.22045e-16
v 0.24339 -2.22045e-16 -2.22045e-16
v -2.22045e-16 0.291306 -2.22045e-16
v -2.22045e-16 -2.22045e-16 0.24339
f 3 2 1
f 6 5 4
f 9 8 7
f 12 11 10
f 15 14 13
f 18 17 16
f 21 20 19
f 24 23 22

```

As you can see, there is no `vn` command. However, if I open it in meshlab and turn on the vertex normal rendering, it shows vertex normals (and some normals not attached to vertices).

Why does this happen?

**Tags:** 3d


---

## 2 answers

### Answer by username_1 on 2021-03-21. Score: 1 | Accepted answer

It is common for modeling software to compute the normals when they aren't included in the loaded file (regardless of the format). This is usually highly dependent on the settings chosen when the file is loaded. Vertex normals can be computed fairly easily. The software can also compute smooth or faceted normals so you can switch between the two.

Your example includes faces...the `f 3 2 1` is a face. Each number refers to one of the vertex values which are numbered starting from the top. `v -2.22045e-16 -0.291306 -2.22045e-16` is vertex number 1 in this case. The software can easily use that information to compute normals.

A normal is computed from the cross product of the edge vectors. Stictly speaking the obj format doesn't compute the actual normals, it just provides the information that Meshlab needs so that Meshlab can compute the normals. which looks something along the lines of:

`facted_normal = normalize( cross( 2-3, 1-3))`

Where the numbers for 1, 2 and 3 are replaced with the actual values for those vertices. Other types of normals are usually computed based of that.

I loaded this file into Blender and it is well behaved, so odds are meshlab has some options turned on that are showing split normals or vertex normals or one of the many other possible variants out there.


---

### Answer by username_2 on 2021-03-21. Score: 1

> Why does this happen?

If no normals are supplied, meshlab probably generates them. This is common behaviour of many 3D applications.

There are various techniques for generating normals (per-vertex, per-face, weighted, non-weighted etc) depending on the desired appearance (smooth/flat shading).

> (and some normals not attached to vertices).

Sound possibly like a bug on meshlab's part. Can you post a screen-shot?

> **Comments:**
> **username_1**: oops we got the same basic answer at almost the same moment haha  
> **username_2**: @username_1 Indeed, I feel you may have ninja'd me slightly by a min ;)  

---

