   getting the edges of a D3DXMESH
  Hello...Some months ago I asked about how to catch the vertex positions of a D3DXMESH and I got it thanks to someone who I don't remember the nickname :P ! ...Using this, I also got the triangles vertices and so on...now I want to get the edges! I wanna know the two vertices which forms the edge. When trying to do it, I have known one thing that I didn't knew: the D3DXMESH is a bitch!!! It sets more than one vertex in the same position. For example a box has 8 vertices right?!? in a D3DXMESH it has 24 vertices(3 for each one)...this is too bad :) ... can anyone help me about ?!?!   
Quote:Original post by xissburgnow I want to get the edges! I wanna know the two vertices which forms the edge. There is no utility function or anything that will give you the edges of a mesh automatically.  But since you have the vertices, you can compute these edges yourself if you need them.Quote:Original post by xissburgIt sets more than one vertex in the same position. For example a box has 8 vertices right?!? in a D3DXMESH it has 24 vertices(3 for each one)It depends on the model.  A box is a special case because it will need to have different normal vectors for each face of the cube.  Even though a vertex may be shared by 3 faces, each of those 3 faces must have a different normal vector.  Therefor, since the vertices (combination of position, normal, tex coords and any other parameters) are not identical, the vertex positions would have to be duplicated to allow for varying normal vectors.neneboricua   ;  Hey, you are the man who taught me how to get the vertex position form a D3DXMESH, neneboricua19...heh...thanks for that againWell, I've understood why more than one vertex in the same position but having the all vertices positions and all vertices indices, how can I get the true edges?!?   ;Quote:Original post by xissburgHey, you are the man who taught me how to get the vertex position form a D3DXMESH, neneboricua19...heh...thanks for that againWell, I've understood why more than one vertex in the same position but having the all vertices positions and all vertices indices, how can I get the true edges?!?Well, you not only have the mesh vertices/indicies, but you also have access to the adjacency information.  So to compute the edges of the mesh, you loop through each of the vertices and then take a look at all of the adjacent vertices.  For each adjacent vertex, you can create an edge.neneboricua   