Sign in to follow this  

Mesh Movement

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

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