Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...