1
\$\begingroup\$

I'm trying to load .obj files in my little game. I decided to use assimp as tool to import those models. But it seems that assimp does not import them correctly.

I looked for a simple cube mesh online and found this one: http://cs.wellesley.edu/~cs307/tw/objects/cube-textures.obj

But when importing the model the number of faces is only 11 instead of 12. I then tested to load the model in the model viewer provider by assimp. But the problem is the same, one face is missing.

Is there anything I'm missing? Here is my loading code:

const aiScene* AssimpScene = this->AssimpImporter.ReadFile("C:/cube.obj",  aiProcess_CalcTangentSpace);
\$\endgroup\$
2
  • \$\begingroup\$ My first guess was that the file was missing an LF at the end, causing the last line to be ignored, but after examining it that doesn't seem to be the case. It appears to be a well formed OBJ; loads in Maya and has correct face normals, so it's not a matter of back face culling. On the other hand it's hard to believe there would be a bug in Assimp's OBJ loader, given it's ubiquity. Is it possible your local copy has been corrupted somehow? \$\endgroup\$
    – bcrist
    Commented Oct 14, 2014 at 23:29
  • \$\begingroup\$ Also, when you say "the model viewer provided by assimp" are you referring to the old assimpview or the new open3mod? The file loads fine for me in the latter. \$\endgroup\$
    – bcrist
    Commented Oct 14, 2014 at 23:38

1 Answer 1

0
\$\begingroup\$

For the people still trying to figure this one out make sure that your .mtl file is also there. Just found out your OBJ is dependent on it

\$\endgroup\$
1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .