XNA Creators Club Online
Page 1 of 1 (7 items)
Sort Posts: Previous Next

D3DX10CreateMesh VertexCount and FaceCount parameters

Last post 7/16/2009 11:49 AM by klempie. 6 replies.
  • 7/13/2009 2:35 PM

    D3DX10CreateMesh VertexCount and FaceCount parameters

    I'm creating a D3D10Mesh to copy the vertex data from a D3D9 mesh. What I want to know is, what is the use of the FaceCount parameter. Surely the number of faces will be determined by the primitive topology you are rendering with? My mesh, for example, I am going to draw using triangle strip so the number of faces (I assume this is equal to number of triangles?) is number of vertices - 2 correct?
  • 7/13/2009 5:18 PM In reply to

    Re: D3DX10CreateMesh VertexCount and FaceCount parameters

    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.

  • 7/13/2009 5:40 PM In reply to

    Re: D3DX10CreateMesh VertexCount and FaceCount parameters

    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).

  • 7/13/2009 7:09 PM In reply to

    Re: D3DX10CreateMesh VertexCount and FaceCount parameters

    why dont you look at the NVUT routines in the NVSDK and how they get vertex data from a D3D9 .x file and into form for D3D10 rendering.

    I use it in my maze article series so its provable it works outside the NV samples.
    http://www.futuregpu.net ex-Aces Lead PM/ex DX SDK PM/ex D3D Evangelist now LRB Launch Native Title Wrangler
  • 7/13/2009 8:39 PM In reply to

    Re: D3DX10CreateMesh VertexCount and FaceCount parameters

    Thanks bro I'll have a look. Are you able to shed any light on the faces vs triangles question?
  • 7/14/2009 2:23 AM In reply to

    Re: D3DX10CreateMesh VertexCount and FaceCount parameters

    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.

  • 7/16/2009 11:49 AM In reply to

    Re: D3DX10CreateMesh VertexCount and FaceCount parameters

    That's awesome man! Thanks for the answer. I've looked at the NVUT stuff too and it looks like they do it the way I envisaged so nice to have that confirmation. Thanks for your help. I'll def be keeping your book at hand.
Page 1 of 1 (7 items) Previous Next