Skip to main content
gamedev.net
🔒 Locked

Code for a Mesh Class

Started by Drath Jan 19, 2003 at 10:59 AM 0 replies 400+ views
Original Post
Drath
Drath
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.
halfdan
halfdan
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.