Inaki Ayucar

Do you mean how to know which polygon a vertex belongs

Meshes are normally divided into parts, usually for using different materials. Each part has a bunch of polygons in it, and each polygon has its vertices.

You need to access the Index Buffer in addition to the vertex buffer, which will tell you what vertices are forming each polygon. It has 3 vertex indices for each triangle, so the index buffer has NumTriangles * 3 entries. For example (IB = IndexBuffer)

IB[0] = index of vertex 0 of triangle 0

IB[1] = index of vertex 1 of triangle 0

IB[2] = index of vertex 2 of triangle 0

IB[3] = index of vertex 0 of triangle 1

IB[4] = index of vertex 1 of triangle 1

IB[5] = index of vertex 2 of triangle 1

and so on...

You can check some tutorials about handling all the geometry info of a model here:

http://graphicdna.blogspot.com/search/label/XNA

Im completing a Custom Content Processor that stores all the info you need about your models. I¡¯ll post it later today.

Hope this helps.