Jump to content
  • Advertisement
Sign in to follow this  
pjyelton

Controlling the mouse

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

Anyone know of a tutorial or instructions on how to move the camera around using the mouse similar to how it works in FPS games? For example the mouse rotates the camera and the WASD keys translate the camera. The translation part is pretty straight forward, its getting the mouse functionality that I'm having issues with. I have a terrain editor that I'm trying out but and I would love to be able to fly around. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
You can modify position of camera doing glTranslatef and glRotatef on projection matrix. So do it after glMatrixMode(GL_PROJECTION) and before glMatrixMode(GL_MODELVIEW). Angles and traslations you have to calculate somehow. Mouse moves need to be handeled by some additional library like glut or sdl.

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!