DirectX Mesh Question

Started by
1 comment, last by Ncyphe 14 years, 1 month ago
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.
Advertisement
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.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

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.

This topic is closed to new replies.

Advertisement