Jump to content
  • Advertisement


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


Direct3D and mesh questions

This topic is 6106 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

well, my question is quite simple (this is strictly related to Direct3D) : for information, I loaded my mesh using D3DXLoadMeshFromXFile 1. is LPDIRECT3DINDEXBUFFER8 equal to DWORD* pIndices ?? if it''s not than what is it ?? 2. Does ID3DXMesh also contains an index buffer, without performing the Optimize method ?? 3. Can I change the drawsubset using this code ?? //ppIB is a pointer to IndexBuffer //ppVB is a pointer to VertexBuffer //curFVF is FVF for the mesh for i=0 to number of material in a mesh g_pd3dDevice->SetStreamSource(0,ppVB,sizeof(curFVF)); g_pd3dDevice->SetVertexShader(curFVF); g_pd3dDevice->SetIndices(ppIB,0); D3DXATTRIBUTERANGE attrib=pAttribTable; g_pd3dDevice->DrawIndexedPrimitive(D3DPT_TRIANGLESTRIP,attrib.VertexStart,cVertices,attrib.FaceStart,attrib.FaceCount); it seems that I can''t or something is wrong with my code. 4. I can''t get the AttributeTable from a mesh, this is the code : D3DXATTRIBUTERANGE* pAttribTable; DWORD AttribTableSize; g_pMesh->GetAttributeTable(pAttribTable,&AttribTableSize); The result is always NULL, can somebody tell me what is the purpose of the second parameter ?? Is it the same as the number of material in a mesh ?? I''ve try to set the AttribTableSize with the number of material but that didn''t work as it always set to 0. 5. The reason I want to do this is that I want to hide a certain part of the mesh based on its texture/material by not drawing the faces, for ex. I want to hide all of the faces that using a banana texture but draw everything else. How can I tell which faces related to the material and how to override the drawsubset method ?? Thank you very much for reading this very long posting.. I hope somebody can give me a solution or anything.. I do respect if someone give me ideas on how it''s done.. but please not just a generic ideas. Trying to implement it in Direct3D is very hard since the documentation on many functions and interfaces really sucks.. and I''ve spent hours trying to figure out the hard way what are those for, how it works and what are those damn parameters really meant to.. :p

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!