Closed Mautar55 closed 3 years ago
They are not actually "repeated". The same vertex may have different texture coordinates when they sharing by different surfaces. Here is an example.
Yeah @arrayJY is right here, this loader will output a unique position for every unique vertex. A unique vertex is every unique combination of position/texcoord/normal . So even if there's only 6036 unique positions in the mesh, there may be more than 6036 unique vertices. To allow referencing each vertex with a single integer index (as in OpenGL, Vulkan, etc.), these re-used positions have to be duplicated. I'd guess that's the case with the suzanne mesh you shared. You could test this in Blender by exporting suzanne without normals and texture coordinates, then you should have # vertices == # positions
.
Ok, learned something new then haha. Thanks for the reply.
It is worth to close this one.
To my understanding, positions is a vector which lenght should be the ammount of vertices*3. That doesn't happen with this mesh (attached). Instead of having 6036 positions, it has 6333. The integrity of the file is ok, since blender and online model viewers handle it correctly. I printed a list and searched the file, some positions are repeated for some reason.
The file contains the model, source code of the program which i used to read it and the list of printed positions.
issue.zip