Menu

Help: mNumVertices

Help
Fish
2011-07-22
2013-06-03
  • Fish

    Fish - 2011-07-22

    Hello,

        I start use assimp to develop my project. When i import one obj file.  I found that the mNumVertices alawys greater than the actual number.

       For ex: we have 100 vertex coordnates in an obj file:  v x y z * 100
       When i import this file it always >100 (depends the pFlags).  The size of mesh->mVertices always > 100

       So my question is: How to get these 100 vertex?

       Thank you for your repond

     
  • Kim Kulling

    Kim Kulling - 2011-07-22

    Hi,

    the obj-format is optimized on size. Each vertex stored in the obj-file is unique. But if you are importing an asset the vertices of the model will be assembled to store positions, normals colors and texture coordinates ( and some other stuff for spefiac effects, if you want them ). So the number of vertices used in a model is greater than the number stored in the obj-file.

    For instance a textured box consists of 6 faces. Each face is a quad triangulated by 2 triangles. Each face has its own texture. So you will need for each edge on a face an unique vertex with a corresponding texture coodinate for the texture of that face.

    Assimp will generate you these vertices and so the number of generated texture are greater than the number stored in the file.

    Kimmi

     

Log in to post a comment.