Jump to content
  • Advertisement
Sign in to follow this  

Controlling the mouse

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!