Jump to content
  • Advertisement
Sign in to follow this  
MrDoomMaster

OpenGL OpenGL Camera with Mouse Control

This topic is 4820 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 trying to figure out how to control the OpenGL camera with the mouse. I do not use GLUT. I create a Win32 Application and all that good stuff. I was planning on using the Window Procedure along with a combination of Win32 functions to control the cursor. I want to do the following: 1) User presses LEFT click and holds. Program hides the cursor and places it in the middle of the screen. 2) User moves mouse while still holding LEFT click. The difference in movement is calculated by doing MiddlePosition - NewPosition. This difference value is used to move the camera. 3) Movement complete. Set the cursor back to the middle and prepare for the next movement. The user must click and hold the left mouse button in order to activate camera movement. The camera movement is disabled and the cursor shows itself again once the user releases the left clicker. So far I have not been able to do this successfully, so if someone could provide some examples I would really appreciate it. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Well that's the thing, I don't have anything to show or else I would have shown something at least.

I need to learn techniques that are used to perform the actions that I have listed above. For now I am going to use polar coordinates to control the movement of the camera.

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!