CSE 581: Controlling the camera using spherical coordinates

assume the eye parameters are:
ddistance to origin
angle1 angle around y-axis, as measured from positive x-axis
angle2 angle up from x-z plane, clamped to [0:Pi/2]

Calculating eye position -

For the mouse interaction -

  1. Left mouse button
  2. Middle mouse button
  3. Each time the angles or distance change, recalculate the eye position, and then redisplay using the updated eye position in the LookAt command