Page 136 - Computer Graphics Handout
P. 136

In one sense, what has failed us is our mathematical formulation, which relieson the use of coordinate axes. However, a deeper and
          less axis-dependent method is embedded within the matrix formulation. Suppose that we start with an arbitrary rotation matrix R.
          All points on a line in the direction d are unaffected by the rotation.
          Thus, for any such point p,
          Rp = p.
          In terms of the matrix R, the column matrix p is an eigenvector of the matrix corresponding to the eigenvalue 1 (see Appendix C).
          In addition, for the direction d,
          Rd = d,

          so that its direction is unaffected by the rotation. Consequently, d is also an eigenvector of R corresponding to another eigenvalue
          of 1. The point p must be the fixed point of the rotation, and the vector d must be the normal to a plane perpendicular to the
          direction of rotation. In terms of the trackball, computing the axis of rotation was equivalent to finding a particular eigenvector of
          the desired rotation matrix.
          We could also go the other way. Given an arbitrary rotation matrix, by finding its eigenvalues and eigenvectors, we also determine
          the axis of rotation and the fixed point.

          3.13.4 Incremental Rotation
          Suppose that we are given two orientations of an object, such as a camera, and we want to go smoothly from one to the other. One
          approach is to find the great circle path as we did with the virtual trackball and make incremental changes in the angle that rotates
          us along this path. Thus, we start with the axis of rotation, a start angle, a final angle, and a desired increment in the angle
          determined by the number of steps we wish to take. The main loop in the code will be of the following form:
          mat4 ctm;
          for(i=0, i<imax; i++)
          {
          thetax += dx;
          thetay += dy;
          thetaz += dz;
          ctm = RotateXm(thetax)*RotateYm(thetay)*RotateZm(thetaz);
          draw_object();
          }
          One problem with this approach is that the calculation of the rotation matrix requires the evaluation of the sines and cosines of
          three  angles.We  would  do  better  if  we  compute  the  rotation  matrix  once  and  reuse  it.  We  could  also  use  the  small  angle
          approximations
          sin θ ≈ θ ,
          cos θ ≈ 1.
          If we form an arbitrary rotation matrix through the Euler angles
          R = Rz(ψ)Ry(φ)Rx(θ),
          then we can use the approximations to write R as
























                                                             136
   131   132   133   134   135   136   137   138   139   140   141