Jump to content
  • Advertisement


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


Code for a Mesh Class

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

I am coding a mesh class but I need something that is flexible. The mesh class will handle static (non-animated) meshes, frame (like MD2) meshes and hard and soft skinned meshes. I will split the model into many parts for the rendering because different textures are used, different shaders are used, there are not enough shader addresses to hold the whole bone skeleton, and I want to change the parts (i.e. various heads can be used, etc). I was wondering what would be the most efficient method. Should I use a seperate vertex and index buffer for each part, should I combine all the vertex buffers and just use different index buffers or should I combine it all and render parts of the index buffer each time. For x number of parts in a mesh, there would be at least 2x number of parts all together.

Share this post

Link to post
Share on other sites
What if you just wrote a function that created and loaded
a Direct3DMesh from your file data. Something with
a interface like

IDirect3DXMesh* LoadMesh(const char* fileName);

Just read in your mesh info, create a directx mesh,
and stuff it with the data from your file.

This way, you can leave the rendering to directx, all you
have to worry about is that the vertex and index buffers are
loaded correctly.

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.

GameDev.net 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!