Jump to content
  • Advertisement
Sign in to follow this  
SumDude

DirectX Questions (Devices, Transformations)

This topic is 5131 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

For every shape or something that i want to draw would i have to create a device for it? Plz don't flame me for this because i just recently got into Direct3D and i am confused on how you would transform shapes different ways without creating multiple Devices. If you want to rotate one shape but have another shape translate to a different area is it really necessary to make a new device??? Sorry if this is a bit of a dumb question.

Share this post


Link to post
Share on other sites
Advertisement
No. Very, very few programs have more than one device.

APIs such as DirectX and OpenGL draw according to the current rendering state. They don't remember what they've drawn, except to keep the picture it around. So if you want to draw one apple at (0, 0) and another apple at (5,1), draw the first apple, set a new model transformation, and draw another apple.

Share this post


Link to post
Share on other sites
Nevermind. I just found out that you need to seperately Draw the primitive while the matrix is set LOL. Its amazing how that is no where on the MSDN site really.

Share this post


Link to post
Share on other sites
You could look at the DirectX tutorials that come with the sdk. Tutorial 3 Using Matrices shows what you want :)

The world matrix translates/rotates/scales an object so just set the world matrix for every object.

D3DXMATRIX matWorld;
D3DXMatrixRotationY( &matWorld, timeGetTime()/150.0f );
g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );

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!