PDA

View Full Version : glutWarpPointer question



dabeav
01-24-2003, 05:25 PM
I wanted to warp my mouse back to the middle of the screen after each move in my 3D sceen. I found glutWarpPointer, but the only problem is that from what i can tell, its for 2D scenes? If I wantd to use it in a gluPerspective(45.0f, fAspect, 0.1, 1000); Scene, what would I use as my X,Y basis? Would I use the resolution values? Or what? Or am i not understanding how this is used?

dabeav
01-24-2003, 06:16 PM
Ok I have now played with this function a little bit, and I get how it works in 3D (Im simply using the resolution size to determin the screen size) Which seems to work ok (Some issues ive yet to solve, but its LATE lol) One question though, WHY? When i put glutWarpPointer(400, 300); Inside of the glutMotionFunc, does it lock up the movment of the renderscene? I am simply not able to translate or rotate when this is inside the motionfunc? Is this a bug, or an inconistancy??

dabeav
01-25-2003, 06:50 AM
Ok what gives? I have been playing with this glut warp pointer for a bit now, and I find that it dosnt work worth a crap. It seems that once I warp it, it STAYS THERE? I was under the impression that it was warped there, and then allowed to move as normal?? All i seem to be getting is a pointer that CONTINOUSLY warps even if the warppointer is not called that frame? Is this right?

zed
01-25-2003, 10:31 AM
2d/3d? its just provides a new position of where to move the cursor to in the actual window space

>>All i seem to be getting is a pointer that CONTINOUSLY warps even if the warppointer is not called that frame? Is this right?<<

calling it will generate a 'mouse has moved' message http://www.opengl.org/discussion_boards/ubb/smile.gif
thus if youre calling it like so

mouse_move_callback(..)
{
glutWarpCursor(..)
}

u will run into some obvious problems which can be worked around though