glut mouse problem (jerky movement)

Started by
2 comments, last by MrWarandieBoy 19 years, 1 month ago
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.
Advertisement
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
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.
ok, that was the problem. thanks a lot for the help.

This topic is closed to new replies.

Advertisement