Jump to content
  • Advertisement
Sign in to follow this  

Mesh Movement

This topic is 3770 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;

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

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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!