0

# Getting all vertices from MeshBuilder?

I want to get all vertices from my MeshBuilder sample. In meshbuilder there is list of normals and positions. Are these positions defining triangle vertices . I am confused because in my cube model there is 36 triangleindices and positions and normals. Each one is 36. So are these positions represent each vertices or what? Should normal count equal triangle count because each triangle have one normal and three vertices.

Customer support service by UserEcho

A mesh is basically defined for positions, triangleIndices and textureCoord. But you can define the vectors normals too, to build a completed mesh. You can define de normals to each position or to each face, thats depends how do you want your model.

I will explain how works MeshBuilder Class:

1) Positions - Collection of vertices

2) TriangleIndices - Collection of indices from de list of positions. Ex: 1 3 2 means that will be build a triangle with the position 1, 3 and 2 from the list of positions, in this order. (The order has influence to decide if the triangle is in back-side or front-side)

3) TextureCoord - Collection of texture coord. The texture coord works with a point (2D - UV coord)

4) Normals - Collection of vectors normals. The vectors normals has big influence in your mesh. I recommend you to study this, like texture coordinates too.

This is the basic to programer 3D.

Thank you for your answer. This was useful for me.