• Advertisement
Sign in to follow this  

Moving objects in Direct3D

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

I am needing guidance on how to move multiple objects in Direct3D. I can move one but I'm having trouble moving two objects independantly. Some sample code I'm using is below:

D3DXMatrixTranslation(&matrix_Boogle, 0.0, -10.0, 0.0);

renderGameCharacter(d3ddev);
d3ddev->SetTransform(D3DTS_WORLD, &matrix_Boogle);

D3DXMatrixTranslation(&matrix_GameScene, 0.0, 0.0, 0.0);
renderGameScene(d3ddev);
d3ddev->SetTransform(D3DTS_WORLD, &matrix_GameScene);

I am initializing the matrices before use to the identity matrix.

I am wanting to know how to move both meshes independantly of one another.

Any help appreciated, thank you.

Andrew

Share this post


Link to post
Share on other sites
Advertisement
I don't know how does your renderGameCharacter work but you should try this:

Create matrix -> Set transform -> Render scene

D3DXMatrixTranslation(&matrix_Boogle, 0.0, -10.0, 0.0);
d3ddev->SetTransform(D3DTS_WORLD, &matrix_Boogle);
renderGameCharacter(d3ddev);


D3DXMatrixTranslation(&matrix_GameScene, 0.0, 0.0, 0.0);
d3ddev->SetTransform(D3DTS_WORLD, &matrix_GameScene);
renderGameScene(d3ddev);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement