Jump to content
  • Advertisement

Archived

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

about meshes.

This topic is 5644 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
Advertisement
hello,

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
hi,

i'll just write down the steps here okay?


LPD3DXMESH pMesh // presumed intialized
LPDIRECT3DVERTEXBUFFER8 pVB;
LPDIRECT3DINDEXBUFFER8 piB;

// on init
dwNumOfVertices = pMesh ->GetNumVertices();
dwNumOfFaces = pMesh ->GetNumFaces();
dwVertexShader = pMesh ->GetFVF();
pMesh->GetVertexBuffer(&pVB);
pMesh->GetIndexBuffer(&pIB);

// on render
pDevice->SetVertexShader(dwVertexShader);
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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!