Sign in to follow this  

Controlling the mouse

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

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