faces {
3 6 1 0 ( (0 144 0) (1 145 1) (9 161 10) )
3 6 1 1 ( (0 144 9) (9 161 10) (16 176 19) )
3 6 1 2 ( (0 144 18) (16 176 19) (23 191 28) )
3 6 1 3 ( (0 144 27) (23 191 28) (30 206 37) )
3 6 1 4 ( (0 144 36) (30 206 37) (37 221 46) )
3 6 1 5 ( (0 144 45) (37 221 46) (44 236 55) )
3 6 1 6 ( (0 144 54) (44 236 55) (51 251 64) )
3 6 1 7 ( (0 144 63) (51 251 64) (58 266 73) )
3 6 1 8 ( (0 144 72) (58 266 73) (65 281 82) )
3 6 1 9 ( (0 144 81) (65 281 82) (72 296 91) )
3 6 1 10 ( (0 144 90) (72 296 91) (79 311 100) )
3 6 1 11 ( (0 144 99) (79 311 100) (1 145 108) )
4 6 1 12 ( (9 161 10) (1 145 1) (2 146 2) (10 162 11) )
4 6 1 13 ( (16 176 19) (9 161 10) (10 162 11) (17 177 20) )
4 6 1 14 ( (23 191 28) (16 176 19) (17 177 20) (24 192 29) )
4 6 1 15 ( (30 206 37) (23 191 28) (24 192 29) (31 207 38) )
4 6 1 16 ( (37 221 46) (30 206 37) (31 207 38) (38 222 47) )
4 6 1 17 ( (44 236 55) (37 221 46) (38 222 47) (45 237 56) )
VA problems with anim8or
I'm really liking anim8or as a free 3D modelling solution. I have but one problem, though. The export format stores an indexed list of faces, which is great, but the number of vertices per polygon is not constant. It is either 3 or 4 (a triangle or a square, obviously) per face. That's a bit of a problem for me, as I intend to use VA/VBOs. Does anyone know of a way (I can't seem to find one) to have anim8or only output triangles?
I don't really think there is one, so I'm guessing I'll just have to work around this limitation. The format for the faces looks like this:
The first number is the number of vertices that the face has. The second is a flag configuration (irrelevent to this discussion). The third is the material number applied to the face and the fourth is an index to the list of normals for the face. Following these four numbers is the list of data points. If I'm reading the file spec correctly, the first in each set represents the element in the vertex array, the second is (I believe, can someone confirm?) a reference for the vertex normal for that particular point, and the third is the point's texture coordinate reference. I really gotta hand it to the guy who wrote this thing. He's provided a bunch of very useful mesh data in an easy-to-interpret manner (you can even export to a .c data file, how cool is that?).
Anyway, what I think I'll do is go one-by-one through each face and if the number of vertices is greater than 3, split the face up into triangles. So that first 4-element face of (9, 1, 2, 10) will become 2 faces: (9, 1, 2) and (1, 2, 10). It's a bit of a pain (especially since I'll have to create 2 new vertices and assign indices to them accordingly), but it's the best way I can think to do it.
Can anyone think of a better way of reading in the data so I can use it in a vertex array? I'd really rather not do it the way I'm planning to (as things will get extra complicated when it comes time to animate the model).
Thanks in advance!
If its a quad you could probably split it during loading. I think if you convert it to a mesh then it will spit out triangles.
Quote:Original post by CRACK123
If its a quad you could probably split it during loading. I think if you convert it to a mesh then it will spit out triangles.
Hmm...a good idea. I selected it and selected Build>>Convert to Mesh and saved it. Upon opening, though, it was still split between 3's and 4's. Any other suggestions? Perhaps I'll email the creator.
Thanks, CRACK123!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement