klempie:
legalize:
D3DX10CreateMesh doesn't have anything to do with rendering. You need to tell it how many faces are going to be stored in the mesh so that it can create resources with enough space.
Thanks for the reply. Does that mean that my understanding of faces is correct? That is, faces = triangles? What if you have a bunch of adjacent coplanar triangles? Does that constitute a single face or many?
Could you explain why the
D3DX10CreateMesh needs the number of faces to calculate resource space? I would have thought the vertices alone would implicitly define them (based on selected primitive topology of course).
Each triangle is a face. Adjacent coplanar triangles do not constitute a single face, there is still one face per triangle.
Meshes are a collection of triangles drawn as an indexed triangle list. See Chapter 19. D3DX Mesh Objects from my book The Direct3D Graphics Pipeline. In particular, look at Figure 19.2 which diagrams out some triangles, their associated vertices and associated indices. In order to identify the amount of space needed for the indices, D3DX needs to know the number of faces. The primitive topology is fixed for a D3DX mesh (it only draws indexed triangle lists), but the number of vertices alone does not define the number of faces in the mesh because adjacent faces may share vertices.