From: Giuseppe B. <el...@gm...> - 2017-05-30 12:40:10
|
As already David Nadlinger mentioned, it's like that because of the real-time 3d graphics, where unfortunately you can't have normal and color per triangle/face. More specifically, the vertex shader in the graphic pipeline expects always data for each vertex attribute. For example, here, you need position, normal and color: https://github.com/g-truc/ogl-samples/blob/b856b8ca236e1b46d40cf514784a25d3eaec5f4f/data/gl-430/buffer-uniform.vert#L17-L19 then each vertex has to come with a position, a normal and a color data (vec*) inside your gpu buffer objects. This is the norm unless very specific cases. Giuseppe 2017-05-30 12:49 GMT+02:00 David Rivkin, PhD <dav...@sc...>: > Why does aiProcess_GenNormals (option to Importer::ReadFile()) generating > a list of Normals for each vertex when there should be just 1 per Face, and > hence the array of mNormals should be equal to the aiMesh.mNumFaces, not > aiMesh.mNumVertices? The normal should be both a aiVector3Dand a Real > scaler (offset typically referred to as 'w' in code for Omega) as well. > > In fact, the documentation is very confusing stating "aiVector3D > <http://www.assimp.org/lib_html/vector3_8h.html#a47f446977120a9ca7d868353aad70b09>* > aiMesh::mNormals > Vertex normals > > The array contains normalized vectors, NULL if not present. The array is > mNumVertices in size...." This should be Face Normals. > > I would consider this a bug. > -- > Thank you, > Prof. David Rivkin, PhD > President & Chief Scientist > SciEssence Intl. > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Assimp-discussions mailing list > Ass...@li... > https://lists.sourceforge.net/lists/listinfo/assimp-discussions > > |