Code: TFace=packed record Material:TMaterial; idices:array of pTIndex; normals:array of TNormal; userdata:pointer;//pointer to special objectdata end; TMesh=packed record vertice:array of TVertex; colors:array of TColors; normals:array of TNormal; uvs:array of TUV; indices:array of TIndex; count:cardinal; Faces:array of TFace; end;
This structure i prefer, because its optimised for vbo.
The each array in TMesh get a own VBO and the Mesh is sorted by Materials, so you can call the Materialscript and can handle Face specific rendering(alpha, shader variables,...).
The TFace get a extra Normal array for stuff like Physic. This normal is not smoothed.
A simular structure you will find in Blender.
I hope it will help you.
|