home *** CD-ROM | disk | FTP | other *** search
/ Computerspiele Selbermachen / computerspieleselbermachen.iso / pov / tour.rta < prev    next >
Text File  |  1994-09-03  |  2KB  |  57 lines

  1. /*
  2.  *  RTAG source file.
  3.  *  Animated tour around some buildings
  4.  *  Written by Phillip H. Sherrod.
  5.  */
  6.  
  7. //  File declarations
  8. bfile "tour";           // Batch file will be tour.bat
  9. //  Variable declarations.
  10. var lastframe = 260;    // Generate 260 frame animation
  11. var x;                  // X position
  12. var y;                  // Y position
  13. var z;                  // Z position
  14. var xlook;              // X to look at
  15. var ylook;              // Y to look at
  16. var zlook;              // Z to look at
  17.  
  18. //  Main animation loop
  19. while (curframe < lastframe) {
  20.     nextframe;              // Begin a new frame
  21.     //  Determine position
  22.     x = spline(curframe, 1,22,  15,14, 30,6,  45,2,  60,-6,
  23.                  75,1,  90,2, 105,4, 120,6, 135,6, 150,4,
  24.                  170,-4, 185,-8, 200,-4, 215,-1, 230,2,
  25.                  240,4, 260,12);
  26.     y = spline(curframe, 1,15,  15,12, 30,6,  45,2,  60,1,
  27.                  75,2,  90,2, 170,2, 200,2, 230,4, 240,8, 260,18);
  28.     z = spline(curframe, 1,-18, 15,-2, 30,-1, 45,-3, 60,0,
  29.                  75,2,  90,-4, 105,-6, 120,-3, 135,3,
  30.                  150,6, 170,8, 185,6, 200,2, 215,-4,
  31.                  230,-2, 240,0, 260,0);
  32.     //  Determine where to look
  33.     xlook = spline(curframe, 1,0, 30,-8, 45,-8, 60,-7, 75,9, 90,4,
  34.                  105,4, 120,0, 200,0, 260,0);
  35.     ylook = spline(curframe, 1,2, 260,2);
  36.     zlook = spline(curframe, 1,0, 30,0,  45,0,  60,6,  75,-4, 90,-4,
  37.                  120,0, 150,0, 200,0, 260,0);
  38.     // Print our position
  39. printf("Frame %3.0lf, pos=(%4.1lf,%4.1lf,%4.1lf), look=(%4.1lf,%4.1lf,%4.1lf)\n",
  40.         curframe,x,y,z,xlook,ylook,zlook);
  41.     //  Write position commands to the include file
  42.     bwrite(":do`###`\n");
  43.     bwrite("if exist tour`###`.tga goto do`+++`\n");
  44.     bwrite("echo #declare xpos = `x` > tour.inc\n");
  45.     bwrite("echo #declare ypos = `y` >> tour.inc\n");
  46.     bwrite("echo #declare zpos = `z` >> tour.inc\n");
  47.     bwrite("echo #declare xlook = `xlook` >> tour.inc\n");
  48.     bwrite("echo #declare ylook = `ylook` >> tour.inc\n");
  49.     bwrite("echo #declare zlook = `zlook` >> tour.inc\n");
  50.     //  Write command to render the frame image
  51.     bwrite("call trg320 tour tour`###` -mv1.0 -p\n");
  52. }
  53. //  Write final batch command to run DTA
  54. epilog;
  55. bwrite(":do`+++`\n");
  56. bwrite("call dodta TOUR /S8\n");
  57.