Jump to content
  • Advertisement
Sign in to follow this  
DarkSlayer

mesh class

This topic is 4913 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 could use the dx mesh class ... but I want a better grip on things.. If I would create a mesh class, what should be in it? I need for each polygon: a vector with 3 floats (x,y,z) a u/v vector 2 floats (texture coordinates) a polygon = 3 x vector a normal for each vertex? a normal for each polygon? a colour for each vertex? a list of textures? something about material? for the entire mesh: a index list? My goal is to load a .x or 3ds file, and load mesh stuff into my mesh class. Then just for fun or simplicity ... convert it to dx mesh class what other things should be in the mesh class? and what should I look out for...

Share this post


Link to post
Share on other sites
Advertisement
Hi,
in my mesh class i have the following basic things.


Mesh
Batches
Primitive (Triangles, Triangle Strip..)
Material Pointer (Typically an abstract class)
Index Buffer
Vertex Buffer
Vertex Attributes (Normals, Texture Coordinates, add whatever you want with AddVertexAttirbute())
Polygons (not used for rendering, but for shadow volume construction etc)
Smoothing Group
Plane Normal
Vertex Indices
List of neighbour polygons




Note, these are just the basics. I also have bones (animation), shadow volume construction, optimize function. A nice thing is AddNormals (or AddTangents) which computes the normals according to the smoothing groups an adds it as a vertex attribute.

Share this post


Link to post
Share on other sites
smoothing groups?

I have touched it slightly in 3Ds Max ... but I don't comprehend it much...

I was thinking of putting animation in a object of itself .. (so I could just assign "new" animation if I wanted)

but you mentioned bones ... I guess I need to store bones one way or the other, but I have little qlues about it ... I haven't done much boning in 3Ds Max ... any tuts about it? I have made several models for C&C Generals (but none that require bones)...

Share this post


Link to post
Share on other sites
do not include material info in a mesh but at a higher up level

mesh_and_material
{
mesh template id
material
...
}

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.

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!