• Advertisement
Sign in to follow this  

Mesh Movement

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

I'm having some serious problems trying to figure out how to get a mesh to move around the screen when I use the arrow keys. Its not implementing the input system but rather getting the mesh to move. Does anyone know a link to a good tutorial for this. I'm using Directx and C++.

Share this post


Link to post
Share on other sites
Advertisement
I'm not sure what sort of effect you want to achieve so I will list a very simple example that moves the mesh left and right:


float x = 0.0f;
if (keyDown(Left))
x -= 2.0f;
if (keyDown(Right))
x += 2.0f;

D3DXMATRIX mat;
D3DXMatrixTranslation(&mat, x, 0, 0);
device->SetTransform(D3DTS_WORLD, &mat);
renderMesh();



If this isn't what you wanted, you'll have to ask a more specific question.

Share this post


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

  • Advertisement