Jump to content
  • Advertisement
Sign in to follow this  
Ncyphe

DirectX Mesh Question

This topic is 3123 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!