Sign in to follow this  
Ncyphe

DirectX Mesh Question

Recommended Posts

I'm still a little newbish of DirectX and still trying to get a grip with everything I can do. My question involves actual loaded Meshes and optimization. After loading a single DirectX Mesh, can I redraw it multiple times within the same BeginScene() EndScene() calls. Say, for example, I had two entities that used the same model source. Instead of loading the same model twice into memory, is it possible to simply draw the same mesh twice (after altering the position, of coarse) on the same frame.

Share this post


Link to post
Share on other sites
Certainly. Create a translation matrix for each position and call:

dev->SetTransform(D3DTS_WORLD,&trans);

before you render the mesh.

Set the world transform for another location and draw the mesh again.

Share this post


Link to post
Share on other sites
Thank you very much, you just ended hours of trying to build a test subject.

I built my Junior Project around a mesh system that duplicated mesh objects in memory. No wonder it ran so slowly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this