home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / raytrace / polyray / dat / animate / ufo / view.inc < prev   
Encoding:
Text File  |  1993-05-02  |  1.7 KB  |  48 lines

  1. //
  2. // Determine the camera direction and angle.  What we look at is based on
  3. // the individual segments of the animation.
  4. //
  5. if (segment == 0) {
  6.    // Counterclockwise pan.  Starts by looking up and away from the
  7.    // location of the launch pad.  At the end of segment 0 we are looking
  8.    // down towards the pad, centered on the hole that the UFO will come out of.
  9.    define view_from  <0, 8, -15>
  10.    define view_ang 30
  11.    define view_at view_from + rotate(<0, 0,-15>, <0, increment * -180, 0>) +
  12.                       increment * <0, -6, 0>
  13.    }
  14. else if (segment == 1) {
  15.    // The UFO rises up from the center hole in the launch pad.  We don't do
  16.    // any camera work during this segment.
  17.    define view_from  <0, 8, -15>
  18.    define view_ang 30
  19.    define view_at <0, 2, 0>
  20.    }
  21. else if (segment == 2) {
  22.    // As the UFO finishes it's climb, we keep the camera pointed directly
  23.    // at it.  The field of view is dropped from 30 degrees at the start of
  24.    // this segment down to 15 degrees at the end.
  25.    define view_from  <0, 8, -15>
  26.    define view_ang 30 - increment * 15
  27.    define view_at <0, 2, 0> + increment * <0, 3, 0>
  28.    }
  29. else {
  30.    // This segment simply keeps the camera a constant distance behind the
  31.    // UFO as it flys across the landscape.  The value "100" below is dependent
  32.    // on the values used for the UFO start_pos and end_pos values for this
  33.    // segment.
  34.    define view_from <0, 8, -15+increment*100>
  35.    define view_ang 15
  36.    define view_at <0, 5, increment*100>
  37.    }
  38.  
  39. // Build the camera according to the values generated above
  40. viewpoint {
  41.    from  view_from
  42.    at view_at
  43.    up <0, 1, 0>
  44.    angle view_ang
  45.    resolution 320, 200
  46.    aspect 4/3
  47.    }
  48.