Sign in to follow this  
pjyelton

Controlling the mouse

Recommended Posts

pjyelton    122
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
lubiluk    122
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

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