Sign in to follow this  
judge dreadz

click and drag mouse functions in GLUT

Recommended Posts

judge dreadz    193
i'm having difficulty implementing click and drag using the GLUT mouse functions. glutMotionFunc does the dragging part, but there doesnt seem a way to monitor which button initiates the call. glutMouseFunc gives the button, but i cant get it to do the dragging (it moves in one jump when you release the button). i'm trying to make it so dragging the mouse moves the camera position. i want dragging with the left button clicked to rotate the camera about the origin, and dragging with the right button clicked to zoom in/out.

Share this post


Link to post
Share on other sites
Fruny    1658
You need to record which button was pressed when glutMouseFunc() fired and use that information to process the dragging accordingly in glutMotionFunc().

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