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 on other sites
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 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 on other sites
do not include material info in a mesh but at a higher up level

mesh_and_material
{
mesh template id
material
...
}

Create an account

Register a new account

• Partner Spotlight

• Forum Statistics

• Total Topics
627638
• Total Posts
2978330

• 10
• 12
• 22
• 13
• 34