Sign in to follow this  

mesh class

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
in my mesh class i have the following basic things.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this