Mesh from Mesh

clulives

Newcomer
Joined
Mar 4, 2004
Messages
1
Location
O.C., Calif.
I'm loading a number of mesh files (.x) which will be scaled and placed statically in the "world". I think the most efficient way to do this is to scale and translate the mesh once rather than every time i render:

1. Is this philosophy correct?
2. How can I translate/scale/rotate a mesh and hold it's transformation as a new mesh?

Thanks in advance.
 
The only way you benefit from this is if you merge several models into a single mesh. Just applying the world matrix and afterwards setting an identity matrix will not save you anything.

If you go into merging then keep in mind that merging too many models will not be good if you don't actually see all of it. It is better to keep it smaller and apply visibility tests on it.

The way to actually do all this is by creating a new mesh. Then lock the source vertex buffer and copy data to the locked buffer of the new mesh. Apply transformation while doing this. I would reccomend that you use GraphicsStream for this. Do the same with index buffer (correctly modify the indices) and attribute buffer.

I haven't gone into details as that would sure be enough talk for a whole article.
 
Back
Top