<img src="http://i53.tinypic.com/2h35xk8.png">
Y is up/down. X is left/right. Z is front/back.
Yaw: rotation around the Y axis - spinning like a top
Pitch: rotation around the X axis - spinning forward/backward
Roll: rotation around the Z axis - spinning side to side
Set yaw to 0 - mousex / 4:[/code:zaizl332]
Sets the angle along the Y axis to mousex (the actual position of the mouse, in pixels). Divided by 4 so it doesn't spin too fast. The "0 -" part inverts the angle so that it spins in the direction of the mouse movement, remove the "0 -" to invert the mouse movement.
[code:zaizl332]Set pitch to clamp(-90,(mousey - 240)/4 ,90)[/code:zaizl332]
Sets the angle along the X axis to mousey, minus the center of the screen. Since the window is 480px tall, that would be 240. Divided by 4 so it doesn't spin too fast. The angle is also clamped between -90 degrees and 90 degrees so you can't look beyond "all the way up" and "all the way down," although David has made a small error in using clamp() here, and the proper expression should read clamp((mousey - 240)/4, -90, 90). Adding "0 -" to the beginning of this would invert the mouse movement.
Hope this helps.