home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / graphics / raydance.lzh / demo_scripts.lha / tutorial26.art < prev    next >
Encoding:
Text File  |  1991-11-12  |  4.7 KB  |  159 lines

  1. !---------------------------------------------------------------
  2. !
  3. ! TUTORIAL26 - RayDance tutorial script #26.
  4. !
  5. ! This script demonstrates animation with hierarchical objects.
  6. !
  7. ! In order to view the animated frames you will need
  8. ! a way of converting the 24 bit frames to HAM (or DCTV or
  9. ! whatever format) and animation playback software.
  10. !
  11. ! Art Department Proffesional tm works well for making HAM
  12. ! pictures from IFF24 pictures.  Possibilities for making anim
  13. ! files are BuildAnim, AStation, or DPAINT4.  DPAINTIII will
  14. ! work for playing back DCTV pictures.
  15. !
  16. ! Concepts include :
  17. !
  18. !  o Frameloops
  19. !
  20. !  o Calculating motion paths
  21. !
  22. !  o PROGRESS variable
  23. !
  24. !---------------------------------------------------------------
  25.  
  26. ? "TUTORIAL26 - This script contains an example of an\n",
  27.   "hierarchical object.  This object consists of several\n",
  28.   "rotating arms sitting atop one another.  Two of the\n",
  29.   "arms have propellors.  Set first and last frames to 50 or\n",
  30.   "more to create frames for an animation.\n";
  31.  
  32. ! The camera looks up the positive y axis
  33. CAMERA'POS = [0,-2000,400];
  34. CAMERA'TARGET = [0,0,200];
  35.  
  36. ! Colors
  37. RED      : color( RGB, [.8, 0, 0] );
  38. BLUE     : color( RGB, [ 0, 0,.8] );
  39. CYAN     : color( RGB, [ 0,.8,.8] );
  40. YELLOW   : color( RGB, [.8,.7, 0] );
  41. GRAY     : color( RGB, [.5,.5,.5] );
  42.  
  43. OFFWHITE : color( RGB, [.8,.8,.6] );
  44. BLACK    : color( RGB, [.1,.1,.1] );
  45.  
  46. ! Create surfaces for our stuff.
  47. MATTE  : surface(PHONG, 0.4,0.8, 0.0,  0,  0,0,0, 0, 0 );
  48. SHINY  : surface(PHONG, 0.4,0.4, 0.1,100, .4,0,0, 0, SILVER );
  49. BRITE  : surface(PHONG, 0.4,0.9, 0.4, 50,  0,0,0, 0, 0 );
  50.  
  51. ! Start the frame loop
  52. frameloop
  53.  
  54.   clearscene;  ! all objects must be created after this
  55.  
  56. ! Arm #1 Create the first layer of hierarchy.  All other 
  57. ! objects will be positioned relative to this one.
  58.  
  59.   object( [0,0,0], [0,0,PROGRESS*-360] )
  60.  
  61.     lathe( ( [20,0,0], [20,0,50] ),
  62.       25, 360, 0, [1,1,1], [0,0,0], [0,0,0],
  63.       RED, MATTE, PHONG ZAXIS OPEN );
  64.  
  65.     extrude( ( [-40,0,10], [-40,0,-10], [40,0,-10], [40,0,10] ),
  66.       400, [0,1,0], [1,1,1], [0,-150,60], [0,0,0],
  67.       RED, MATTE, 0 );
  68.  
  69. ! Arm #2, a counter rotating arm assembly atop the first one.
  70. ! The motion and position of this one will be relative to its
  71. ! position on the first one.
  72.  
  73.     object( [0,200,80], [0,0,PROGRESS*360*3] )
  74.  
  75.       lathe( ( [15,0,0], [15,0,60] ),
  76.         21, 360, 0, [1,1,1], [0,0,0], [0,0,0],
  77.         BLUE, MATTE, PHONG ZAXIS OPEN );
  78.  
  79.       extrude( ( [-50,0,8], [-50,0,-8], [50,0,-8], [50,0,8] ),
  80.         600, [0,1,0], [1,1,1], [0,-150,50], [0,0,0],
  81.         BLUE, MATTE, 0 );
  82.  
  83. ! The propeller assembly for arm #2.
  84.  
  85.       object( [0,400,60], [PROGRESS*360*6,0,0] )
  86.  
  87. ! Propeller shaft
  88.         lathe( ( [-85,0,0], [-77,0,6], [-70,0,12], [50,0,12],
  89.                  [60,0,11], [61,0,0] ),
  90.           21, 360, 0, [1,1,1], [0,0,0], [0,0,0],
  91.           GRAY, BRITE, PHONG XAXIS );
  92.  
  93. ! Propeller blade #1
  94.         extrude( ( [0,7,0], [.2,7,0], [1,-7,0],[.8,-7,0] ),
  95.           120, [0,0,1], [1,1,1], [-70,0,0], [0,0,0],
  96.           YELLOW, BRITE, 0 );
  97.  
  98. ! Propeller blade #2
  99.         extrude( ( [0,-7,0], [.2,-7,0], [1,7,0],[.8,7,0] ),
  100.           120, [0,0,-1], [1,1,1], [-70,0,0], [0,0,0],
  101.           YELLOW, BRITE, 0 );
  102.  
  103.       endobject  ! end of arm #2 propeller assembly
  104.  
  105. ! Arm #3, another arm perched atop arm #2.  This arm will also
  106. ! have a propeller assembly
  107.  
  108.       object( [0,-100,58], [0,0,PROGRESS*360*2] )
  109.  
  110.         lathe( ( [15,0,0], [15,0,90] ),
  111.           21, 360, 0, [1,1,1], [0,0,0], [0,0,0],
  112.           CYAN, BRITE, PHONG ZAXIS OPEN );
  113.  
  114.         extrude( ( [-30,0,8], [-30,0,-8], [30,0,-8], [30,0,8] ),
  115.           200, [0,-1,0], [1,1,1], [0,50,90], [0,0,0],
  116.           CYAN, MATTE, 0 );
  117.  
  118. ! The propeller assembly for arm #3.
  119.  
  120.         object( [0,-100,90], [PROGRESS*-360*7,0,0] )
  121.  
  122. ! Propeller shaft
  123.         lathe( ( [-50,0,0], [-47,0,6], [-40,0,12], [35,0,12],
  124.                  [40,0,10], [45,0,0] ),
  125.           21, 360, 0, [1,1,1], [0,0,0], [0,0,0],
  126.           GRAY, BRITE, PHONG XAXIS );
  127.  
  128. ! Propeller blade #1
  129.           extrude( ( [0,7,0], [.2,7,0], [1,-7,0],[.8,-7,0] ),
  130.             80, [0,0,1], [1,1,1], [-37,0,0], [0,0,0],
  131.             YELLOW, BRITE, 0 );
  132.  
  133. ! Propeller blade #2
  134.           extrude( ( [0,-7,0], [.2,-7,0], [1,7,0],[.8,7,0] ),
  135.             80, [0,0,-1], [1,1,1], [-37,0,0], [0,0,0],
  136.             YELLOW, BRITE, 0 );
  137.  
  138.         endobject  ! end of arm #3 propeller assembly
  139.  
  140.       endobject  ! end of arm #3
  141.     endobject  ! end of arm #2
  142.   endobject  ! end of arm # 1
  143.  
  144. ! Specify the lighting.
  145.   ambient( [0,0,0], [0.6,0.6,0.6], [0,0,1], 0, 0 );
  146.   star( [40000,-50000,60000], [1,.9,1], 300 );
  147.  
  148. ! A gingham ground to fly over
  149.   ground( GINGHAM, 0, 400, OFFWHITE, SHINY, BLACK, SHINY );
  150.  
  151. ! A plain black background
  152.   background( PLAIN, [0,0,0] );
  153.  
  154.   render;
  155.  
  156. nextframe  ! end of the frame loop
  157.  
  158. END
  159.