Jump to content
  • Advertisement
Sign in to follow this  

Different types of meshes and how to structure them in code

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

Hi, I'm trying to design a class hierarchy that different types of meshes will use.
They all will share a base class cMesh, and different types will derive from them.

So far, I've heard of these kinds of meshes that are different from the normal onces:
Skinned mesh
Rigged meshes (does this count?)

What other subsystems are needed to say, get a skeleton mesh working? (physics rigid body dynamics?)
In the case of a skinned mesh, I've been told it blends between vertex weights, and so need an animation system.

Also, is it wise to integrate animation components into my mesh classes? Or should they be seperate?
Plus, would appreciate it if you guys can bring up some other kinds of meshes that might matter.


Share this post

Link to post
Share on other sites
All three are actually the same thing.

A "rig" is the skeleton, and a "skin" is the mesh.

If you use hardware skinning, all you need to draw the meshes are the vertex / index data and shader parameters. So you don't need to derive a class from cMesh to do that, what I would do is have a class that represent the skeleton and can generate the shader data on demand. That way, if you want to add ragdoll animations, you don't have to make the physics and mesh closely coupled. Whatever game object wrapper class you have will contain a mesh and skeleton, and the animation can be played (if it's a prerendered animation) or the simulation can be stepped (it it's a ragdoll system) and the game object updates the mesh's shader parameters with the updated data from the skeleton.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!