jordan____ at July 14th, 2009 05:14 — #1
The assimp documentation is very short and there is just one incomplete pseudo code method. I tried the code below which result in black screen:
void RenderNode(const aiNode * node, aiMatrix4x4 accumulatedTransform)
if (node->mNumMeshes > 0)
for (int m=0; m < node->mNumMeshes; m++)
aiMesh* mesh = scene->mMeshes[m];
for (int f =0; f< mesh->mNumFaces; f++)
aiFace * face = &mesh->mFaces[f];
for (int v=0; v<3; v++)
glVertex3f( mesh->mVertices[ face->mIndices[v]].x/100000,mesh->mVertices[ face->mIndices[v]].y/100000,mesh->mVertices[ face->mIndices[v]].z/100000);
transform = node->mTransformation * accumulatedTransform;
glMultMatrixf((const GLfloat *) &transform);
for (int i=0; i<node->mNumChildren; i++)
I call the method in this way:
What am I doing wrong? Thank you very much in advance.
kenneth_gorking at July 14th, 2009 09:51 — #2
Since you are dividing the vertices with 100000, there is a good chance that the model is simply too small to see.
reedbeta at July 14th, 2009 13:09 — #3
BTW, you can use the ...[/code] tags to post code. [code]...[/code****] tags to post code.
jordan____ at July 14th, 2009 15:55 — #4
Thank you for both replies. I added the division so that the object coordinates are in the field of view. I also found that if I remove the ModelView transformation from the code, some parts of the model are visible.