Advertisement Jump to content


This topic is now archived and is closed to further replies.


about meshes.

This topic is 5891 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

got a few questions about meshes. maybe someone could help. 1. what does Drawsubset draw?. 2. How do i render a mesh without using Drawsubset? (pleeease code) 3. what is a subset. 4. And how can i keep the subset apart when i making a 3d model in, lets say 3D studio.

Share this post

Link to post
Share on other sites

1. it renders a part of the mesh, say you have a cube and a sphere made in milkshape, drawsubset zero would draw cube, then 1 would draw sphere

2. you have to extract the VB and IB, use ID3DXBaseMesh::GetVertexBuffer(..) ID3DXBaseMesh::GetIndexBuffer(...), then render them manually by using DrawIndexPrimitive..,

3. a part i guess

4. well i think if you don''t group them in the modeling package, their are considered subsets..,

Share this post

Link to post
Share on other sites

i'll just write down the steps here okay?

LPD3DXMESH pMesh // presumed intialized

// on init
dwNumOfVertices = pMesh ->GetNumVertices();
dwNumOfFaces = pMesh ->GetNumFaces();
dwVertexShader = pMesh ->GetFVF();

// on render
pDevice->SetStreamSource(0, pVB, sizeof(CUSTOMVERTEX));
pDevice->SetIndices(pIB, 0);
pDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, dwNumOfVertices, 0, dwNumOfFaces);

well, i guess that's about it, just don't forget that your CUSTOMVERTEX struct should contain the required data according to your fvf, you could check your mesh fvf with the mesh viewer, usually it comes with a position, normal, and tex coords,

[edited by - mickey on December 7, 2002 1:44:13 AM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!