The Assimp
library provides conversion tools for reading resource files, such as those for 3D mesh models, and provides a generic format on the application's side. For a 3D mesh file, Assimp
provides us with an aiScene
object that contains all the meshes and related data as described by the imported file.
After importing a model, we need to read the sets of data that we require for rendering. These are the types of data:
Vertices (positions)
Normals
Texture mapping (UV)
Indices
Vertices might be obvious; they are the positions of points between which lines of basic geometric shapes are drawn. Usually, three vertices are used to form a triangular face, which forms the basic shape unit for a model.
Normals indicate the orientation of the vertex. We have one normal per vertex.
Texture mapping is provided using so-called UV coordinates. Each vertex has a UV coordinate if texture mapping information is provided with the model.
Finally, indices are values provided per face, indicating...