Sign in to follow this  

glut mouse problem (jerky movement)

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

hello all im sure this problem has probably been discussed before, but unfortunately the search function is 'temporarily unavailable', so please dont get too upset with me. ive been writing a first person perspective 3d program for a bit of fun. ive been using glut because of its ease of use. i know its (potentially) not the best for writing anything more than fairly simple 3d programs, but it allows me to concentrate on the 3d graphics side of things instead of the windows programming side of things (although i want to learn that at some stage too). anyway... my problem is that the mouse motion functions dont seem to work properly. im changing the pitch and yaw of my view via the mouse; each time the glutMotionFunc or glutPassiveMotionFunc are called i grab the position of the cursor, work out the mouse movement since the previous frame and then move the mouse back to the centre of the screen (a pretty standard method for doing this, as far as i know). my problem: if i move the mouse slowly the motion functions sometimes arent called. this of course means that my pitch/yaw arent updated for quite a few frames, which gives me very jerky motion. i have the cursor enabled so that i can see what the mouse is doing; sometimes i can move the mouse pretty much to the edge of the screen before glut runs the motion function (and therefore updates the pitch/yaw and move the cursor back to the centre of the screen). has anyone else come across this problem? any ideas on ways to fix it? or is this just something that glut users have to deal with? if so, i guess i'll be learning windows programming earlier than i had intended. thanks a lot for reading this. extra thanks for anyone who can help at all.

Share this post


Link to post
Share on other sites
im not to sure what the error is, u r calling warpcursor i assume (this from memory calls another mousemovement call which aint good, so u need to ignore this extra one)

perhaps look into sdl, its just as easy as glut and has a more flexible basis

Share this post


Link to post
Share on other sites
im using glutWarpPointer.

ive had a look around now that youve mentioned this and it seems as though it may actually be glutWarpPointer that is causing the problem.

ill investigate more later today. thanks.

Share this post


Link to post
Share on other sites

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