Sign in to follow this  
Andrew1979

Moving objects in Direct3D

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this