jnewlin
06-04-2012, 09:01 AM
Hi,
I am using Assimp to load obj files into my program. I want to take that data and construct my own data structure. My problem is that Assimp by default loads in repeated vertices, based on however many faces point to each vertex. So for a cube, I would want Assimp to load only 8 vertices.
For a more explicit example, here is part of the obj file maya outputs for a simple cube:
v -1.000000 -1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 1.000000
v 1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
v 1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
...
f 1 2 4 3
f 3 4 6 5
f 5 6 8 7
f 7 8 2 1
f 2 8 6 4
f 7 1 3 5
I would like assimp to give me that data. Instead, it gives me indices from 1->23, and repeats the vertices to match those indices.
I tried using aiProcess_JoinIdenticalVertices in my call to Importer::ReadFile, but that did not have the desired effect.
Has anyone had a similar problem and found a fix?
Thanks!
I am using Assimp to load obj files into my program. I want to take that data and construct my own data structure. My problem is that Assimp by default loads in repeated vertices, based on however many faces point to each vertex. So for a cube, I would want Assimp to load only 8 vertices.
For a more explicit example, here is part of the obj file maya outputs for a simple cube:
v -1.000000 -1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 1.000000
v 1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
v 1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
...
f 1 2 4 3
f 3 4 6 5
f 5 6 8 7
f 7 8 2 1
f 2 8 6 4
f 7 1 3 5
I would like assimp to give me that data. Instead, it gives me indices from 1->23, and repeats the vertices to match those indices.
I tried using aiProcess_JoinIdenticalVertices in my call to Importer::ReadFile, but that did not have the desired effect.
Has anyone had a similar problem and found a fix?
Thanks!