Why does OBJ export writes face normals instead of vertex?

Why does OBJ export writes face normals instead of vertex?

When I export a (default) cube object (8 vertices, 6 faces) to OBJ and then inspect the OBJ file, the “vn” entries obviously correspond to face normals and not to vertex normals. That is clear from the values and the fact that there are only 6 “vn” entries.

How do you make an OBJ cube in Photoshop?

To make a cube of your desired size, change the 76.2 everywhere to your dimensions. Below the vertices, copy the following text: vn and vt refer to the normals and UV texture coordinates for this cube. For the purpose of the tutorial, copy these values exactly.

Which is the first triangle of an OBJ cube?

For example, the first triangle of the cube f 1/1/1 2/2/1 6/4/1 is made up of the 1st, 2nd and 6rd vertices, the 1st, 2nd and 4th texture coordinates and the 1st vertex normal. The second triangle f 1/1/1 6/4/1 5/3/1 is made up of the 1st, 6th and 5th vertices, the 1st, 4th and 3rd texture coordinates and the 1st vertex normal.

How many triangles are there in a cube?

There are 12 triangles for the 6 faces of the cube. For example, the first triangle of the cube f 1/1/1 2/2/1 6/4/1 is made up of the 1st, 2nd and 6rd vertices, the 1st, 2nd and 4th texture coordinates and the 1st vertex normal.

How to export vertex normals in OBJ file Blender?

Each face points to its vertex indices and (via the number after the second slash /) to the belonging vertex normal indices (f v//vn – the middle can also have an index for texture coordinate –> f v/vt/vn). So multiple vertices may be associated with the same vertex normal index if they share the same value.

How to create vertex index-vertex normal in OBJ?

So in order to have a dictionary (vertex index – vertex normal) you would need to go through the faces (the f-group) and follow the reference for each vertex normal, discarding all vertex indices you already have sampled. There are sometimes more ‘vn’s than ‘v’s, because there are actually more vertices.

Are there any duplicates in the OBJ file?

While exporting the OBJ file, only “Write Normals” option is checked. Here is the content of the generated OBJ: They are vertex normals. But because your cube is flat shaded, there are only 6 unique vector directions. In the obj file there are no duplicates.

How to import normals from an OBJ file?

Import from file (The default.) Imports the normals used in the OBJ file. If the OBJ file does not have normals, generates normals using the imported smoothing groups. If the OBJ file does not specify smoothing groups, generates normals by assigning all faces smoothing group 1. From SM group Generates normals from imported smoothing groups.

What do you need to know about obj format?

OBJ is a widely used de facto standard in the 3D industry. The OBJ format is a popular plain text format, however, it has only basic geometry and material support. There is no support for mesh vertex colors, armatures, animation, lights, cameras, empty objects, parenting, or transformations.