Sign in to follow this  

Is this how objects are moved?

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

Hello, I have done a small test to see how cd3dmeshes are to be set in the correct place as there is no set position functions for them... D3DXMATRIX matWorld; D3DXMatrixTranslation( &matWorld, 0, 0, 50 ); m_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld ); if(FAILED(m_pMeshOne->Render(m_pd3dDevice, true, true))) MessageBox(m_hWnd, "Could not render Mesh 1", "Error", MB_OK); D3DXMatrixTranslation( &matWorld, 0, 0, 0 ); m_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld ); Is this the method that should be used? I.e. Move the world matrix to the position you want the object, render the object, move the matrix to where you want the next object, render, and so on? Is this correct? It seems abit complicated and sounds like alot of work for my poor old comp...

Share this post


Link to post
Share on other sites
yes, that is how you are meant to do it (ie. SetTransform->Draw->SetTransform->Draw->etc).

In d3d9/vs3.0 you can do mesh instancing on the hardware (you pass per instance data in a second VB stream), but you probably dont have access to that shaders version (unless you do it in software). :)

[edit]Oh okay, i just realized you weren't talking about instancing. My first paragraph still applies tho :P[/edit]

Share this post


Link to post
Share on other sites

This topic is 4867 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.

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