home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Graphics / graphics-16000.iso / msdos / raytrace / rayshade / examples / coin.ray < prev    next >
Text File  |  1992-02-09  |  1KB  |  49 lines

  1. /*
  2.  * Rayshade animation example.
  3.  * Copperish coin flipping on ground plane.
  4.  *
  5.  * Craig Kolb and Rod Bogart
  6.  * March, 1991
  7.  *
  8.  * $Id: coin.ray,v 4.0 91/07/17 14:25:52 kolb Exp Locker: kolb $
  9.  *
  10.  * $Log:    coin.ray,v $
  11.  * Revision 4.0  91/07/17  14:25:52  kolb
  12.  * Initial version.
  13.  * 
  14.  *
  15.  */
  16. surface copper ambient 0.2 0.05 0.05 diffuse 0.7 0.3 0.2
  17.     specular 0.8 0.4 0.4
  18. sample 4 jitter
  19. plane 0 0 0 0 0 1
  20.  
  21. name coin list
  22.     cylinder 1  0 0 0  0 0 0.2
  23.     disc 1 0 0 0  0 0 -1
  24.     disc 1 0 0 .2  0 0 1
  25. end
  26.  
  27. frames 32
  28. define length 30    /* # of frames of movement */
  29. define flips 4        /* # of flips performed by coin */
  30. define zenith 7        /* height at top of flip */
  31.  
  32. define spin (linear(0, 0, length, 360 * flips))     /* theta */
  33. define ground (linear(0, 2, length, -2))     /* translation */
  34.  
  35. define shift (linear(0,0,length,length) - length / 2)
  36. define height (zenith * ( 1 - shift * shift / (length * length / 4) ))
  37.  
  38. object copper coin
  39.     rotate 1 -1 0  (spin)
  40.     translate (ground) (ground) (height)
  41.  
  42. eyep 0 -9 4
  43. lookp 0 0 (zenith / 2)
  44. fov 55
  45. screen 400 400
  46. shutter 1
  47. framelength 1
  48. starttime -1
  49.