Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

PGstudio

Translating with Direct3D

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

hi guys... i´m having a problem translating one object in my scene with 3 objects( a car, a spaceship and the Level ) i´m using this code to translate each object: D3DXMatrixTranslate ( X,y,z , &MatrixCar ) // for the car . 3DDevice->SetTransform( D3DTS_WORLD, &MatrixCar ); D3DXMatrixTranslate ( X,y,z , &MatrixSpaceShip ) // for the SpaceShip . 3DDevice->SetTransform( D3DTS_WORLD, &MatrixSpaceShip ); D3DXMatrixTranslate ( X,y,z , &MatrixLevel ) // for the Level . 3DDevice->SetTransform( D3DTS_WORLD, &MatrixLevel ); Is it wrong ??? When i move the car, the Spacehip moves.. when i move my level the car moves.... i monitored the coordinates of the 3 objects and they are all ok... i think thr problem is that D3DTS_WORLD transformation with 3 diferent matrices... I tryed to multiply all objects matrices and then use the result matrix as the world.... but it didn´t worked.. : ( Any solutions ??

Share this post


Link to post
Share on other sites
Advertisement
G''day!
(in pseudo-code, ''cuz I''m lazy)

Build CarMatrix
Set CarMatrix
Draw Car

Build SpaceshipMatrix
Set SpaceshipMatrix
Draw Spaceship

etc.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!