Forum > Miscellaneous
[Solved][M2] What is the order of vertices ?
(1/2) > >>
Unbreakables:
Hello everyone !
I'm working on display a M2 model (3.3.5) on a OpenGL/C++ program, and I have a problem with faces.
Vertices seem at the good place, but I don't understand what is the order of vertices (or if there is a order) to draw triangle faces. I tried several option of the draw function of OpenGL, but nothing seem working. I tried to extract vertices in sequence and in reverse.
I try to find some extra documentation but I'm very neophyte in 3D and I don't know what I must looking for exacly. If you have some hints on the problem, I'd greatly appreciate it.
schlumpf:
I guess you missed the fact that there is an indices block? Vertices are used multiple times and the order in the vertices block is random.
https://wowdev.wiki/M2/.skin#Indices and the triangles block define the order.
Unbreakables:
Ah okay, it works like this. It's exacly what I need, thanks !
Unbreakables:
For faces, it seem working. For each triangles, I put vertices coords in a array and use VertexAttribArray to send it to GL. I tried to do the same thing with textures coords, but this make a true puzzle.
I surely do something in the wrong way but I don't see other mention of textures coords in the wiki.
schlumpf:
Sorry, can’t really help there. If the vertices are correct the texcoords right next to them should be. After all it isn’t even a separate list.
Without code I’m not sure how we could help here.
Navigation
[0] Message Index
[#] Next page
|