Method of storing meshes
Just asking, does everyone normally store mesh in a vertex and index array and when you need to render them, you load the buffer and call DrawIndexedPrimitive.
Or just store the mesh in thoes predefine structure like LPD3DXMESH and render them using DrawSubsets().
I know that in certain instance I need the vertex and index array of the mesh, for example when i want to build a bsp tree or octree, i would need its vertex and index.
What kind of storage method is most preferable or better?
Unless you need to do something special with all the data, probably the one that makes it easier for you to render it.
For instance, if you didn't know, in OpenGL, there is a function to draw indexed triangle lists, so, I keep everything, like you said, in 2 different arrays. Or, for more compilcated models, in an array of vertex objects and define the arrays for normal, vertices, tex coords, etc, and then draw all of them with a call to a single function.
If you didn't understand, or didn't read that last paragraph, put it in the one that makes it easiest to render.
For instance, if you didn't know, in OpenGL, there is a function to draw indexed triangle lists, so, I keep everything, like you said, in 2 different arrays. Or, for more compilcated models, in an array of vertex objects and define the arrays for normal, vertices, tex coords, etc, and then draw all of them with a call to a single function.
If you didn't understand, or didn't read that last paragraph, put it in the one that makes it easiest to render.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement