Importing 3d model(fbx) using Assimp creates higher number of vertices than original 3d model

140 views Asked by At

I have a simple human face 3d model with 468 vertices. In blender stats also shows 468 vertices and 898 faces, when I import/read using Assimp, it becomes 2694 vertices(which I think 3×number of faces).I am storing these vertices in vector std::vector<Vertex> vertices; . Everything working fine I have already rendered this model using Assimp. I want to update these original vertices (which are 468 in original model) dynamically on each frame as I am using some third party lib which gives me updated 468 vertices(positions) and 898 indices on every frame. My question is how can I update/set these 468 vertices dynamically. I cant figure out how to query that vertex array initialized from Assimp (which has size 2694 and that of new vertices is 468).

I have read somewhere that Assimp creates additional vertices according to normals, uvs or materials etc. Currently my scene have only single mesh.

1

There are 1 answers

0
KimKulling On

This is an optimization for rendering. Let me explain this:

The number of stored vertices in the most file formats are optimized for size. For a cube you need to define 8 vertices.

It is a different story when you want to render this cube. You need to generate 2 triangles for each of the 8 faces. For each triangle you will need:

  • Position
  • Vertex Color
  • Normal vector depending on the face orientation
  • Maybe more

For a cube described by 8 corners you will need to generate 12 triangles with separate vertices for each face. So from 8 edge positions the number will increase to 24 vertices with all the needed information for rendering.

These vertices can directly be used to fill your render buffers for your render API.