Skip to main content
GameDev.net gamedev.net
🔒 Locked

Mouse Look ???

Started by Tony798 Jan 1, 2001 at 9:12 AM 2 replies 550+ views
Original Post
Tony798
Tony798
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
fastian
fastian
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.
RealityMonster
RealityMonster
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..

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.