Mouse Look ???
Hi,
I''d like to implement the following using glut and preferably keep it compatible with Linux systems: A mouselook system like in Quake. The direction in which the user looks is dictated by the mouse and when the user moves (say forwards) he moves along the normal to this direction. The normal bit isn''t the problem. It''s the mouse orientation part which I''m stuck on. Heeeelllp !
Thanks
you can do this...
- first of all set the mouse pointer to the center of screen like 320*240 using glutWarpPointer
- get your current mouse coordinates using glutPassiveMotionFunc
and subtract them from the center of the screen(like 320*240)
- add the difference in your rotation angles for x and y axes.
- first of all set the mouse pointer to the center of screen like 320*240 using glutWarpPointer
- get your current mouse coordinates using glutPassiveMotionFunc
and subtract them from the center of the screen(like 320*240)
- add the difference in your rotation angles for x and y axes.
i have written a small class that encapsulates the camera functions.
its as simple as camera.placeCamera() int your DrawGLScene to get mouseLook and movement.
plus its got camera.moveForward() camera.moveBack() turnleft lookup etc.. which can be called in your keybd routine.
mail me if u want it..
its as simple as camera.placeCamera() int your DrawGLScene to get mouseLook and movement.
plus its got camera.moveForward() camera.moveBack() turnleft lookup etc.. which can be called in your keybd routine.
mail me if u want it..
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement