home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / msdos / raytrace / pov / gen / campath1 / campath.bas next >
Encoding:
BASIC Source File  |  1991-09-17  |  21.5 KB  |  419 lines

  1. DECLARE FUNCTION FrameFix$ (frm AS SINGLE)
  2. DECLARE SUB ShowGrid ()
  3. '----------------------------------------------------------------------------
  4. '   09/17/91                   CamPATH v1.0                  John Hammerton
  5. '----------------------------------------------------------------------------
  6. '     Here's the QuickBASIC 4.5 for CamPATH1.EXE. One warning: I write some
  7. '  very sloppy BASIC code; I've made no attempt at order or optimization.
  8. '     If you want to experiment with other Polar shapes, the variables are
  9. '  a, b and c and the equation I used begins at line 2500. This is a very
  10. '  simple & general equation and can be altered almost endlessly. For
  11. '  continuous animations, however, we must make paths that return to their
  12. '  origin. For instance, spirals with the equation r^p = m*theta^n make very
  13. '  interesting animations, spining through countless revolutions and zooming
  14. '  in on your object as it goes, but they're not continuous. The animation
  15. '  plays great until it's over - then it jerks to a restart.
  16. '     This program is extremely basic and is just a taste of what you can
  17. '  do with paths. You could also use the XPOS and ZPOS in an object's
  18. '  TRANSLATE command instead - to send IT flying in strange new orbits!
  19. '  Having several objects orbit seperately AS the camera follows a CamPATH
  20. '  paths is very simple to code also (just add in the inputs and increment
  21. '  those variables inside the main loop) but that's just too much junk for
  22. '  a "basic" user to worry about at first...maybe next time.
  23. '    If you come up with a path equation that does something new
  24. '  (and worthwhile) LET ME KNOW - and we'll get it into the next version.
  25. '
  26. '----------------------------------------------------------------------------
  27.  
  28. 10 SCREEN 12                        ' 640x480x16 VGA mode
  29.    WINDOW (-320, 240)-(320, -240)   ' Center screen about (0,0) using
  30.    pi = 3.14159                     '   rectangular coord. standards
  31.  
  32. 20 ShowGrid
  33.    LOCATE 19, 1: COLOR 15: PRINT " PATH TYPE:";
  34.    LOCATE 19, 14: COLOR 11: PRINT "1) Circle";
  35.    LOCATE 20, 14: COLOR 14: PRINT "2) Ellipse";
  36.    LOCATE 21, 14: COLOR 10: PRINT "3) Lemniscate (Rose)";
  37.    LOCATE 22, 14: COLOR 9: PRINT "4) Limacon (Loop)";
  38.    LOCATE 23, 14: COLOR 12: PRINT "5) About CamPATH";
  39.   DO: t$ = INKEY$
  40.    IF t$ = "1" OR t$ = "C" OR t$ = "c" THEN col = 11: GOTO 100
  41.    IF t$ = "2" OR t$ = "E" OR t$ = "e" THEN col = 14: GOTO 200
  42.    IF t$ = "3" OR t$ = "R" OR t$ = "r" THEN col = 10: GOTO 300
  43.    IF t$ = "4" OR t$ = "L" OR t$ = "l" THEN col = 9: GOTO 400
  44.    IF t$ = "5" OR t$ = "H" OR t$ = "h" OR t$ = "A" OR t$ = "a" THEN 7000
  45.    IF t$ = CHR$(27) OR t$ = "Q" OR t$ = "q" OR t$ = "X" OR t$ = "x" THEN 9000
  46.   LOOP
  47.  
  48. 100 ' -----  Get data for CIRCLE  -----
  49.     ShowGrid
  50.     LOCATE 19, 2
  51.     COLOR col: PRINT "CIRCLE:"
  52.     COLOR 15: PRINT "  Radius of circle";
  53.     COLOR col: INPUT " [Enter] = 200 "; r(1)
  54.     IF r(1) = 0 THEN r(1) = 200
  55.     r(2) = r(1)
  56.     COLOR 15: PRINT "  X-Offset from center";
  57.     COLOR col: INPUT " [Enter] = none "; Xoff
  58.     COLOR 15: PRINT "  Z-Offset from center";
  59.     COLOR col: INPUT " [Enter] = none "; Zoff
  60.     COLOR 15: PRINT "  How many FRAMES for this path";
  61.     COLOR col: INPUT " [Enter] = 120 "; num
  62.     IF num = 0 THEN num = 120
  63.     GOTO 1000
  64.  
  65. 200 ' -----  Get data for ELLPISE  -----
  66.      ShowGrid
  67.      LOCATE 19, 2
  68.      COLOR col: PRINT "ELLIPSE:"
  69.      COLOR 15: PRINT "  Major axis (X-Axis)";
  70.      COLOR col: INPUT " [Enter] = 200 "; r(1)
  71.      COLOR 15: PRINT "  Minor axis (Z-Axis)";
  72.      COLOR col: INPUT " [Enter] = 200 "; r(2)
  73.      IF r(1) = 0 OR r(2) = 0 THEN r(1) = 300: r(2) = 140
  74.      COLOR 15: PRINT "  X-Offset from center";
  75.      COLOR col: INPUT " [Enter] = none "; Xoff
  76.      COLOR 15: PRINT "  Z-Offset from center";
  77.      COLOR col: INPUT " [Enter] = none "; Zoff
  78.      COLOR 15: PRINT "  How many FRAMES for this path";
  79.      COLOR col: INPUT " [Enter] = 120 "; num
  80.      IF num = 0 THEN num = 120
  81.      GOTO 1000
  82.  
  83. 300 ' -----  Get data for LEMNISCATE -----
  84.     ShowGrid
  85.     LOCATE 19, 2
  86.     COLOR col: PRINT "LEMNISCATE (rose):"
  87.     COLOR 15: PRINT "  Number of rose petals (3-12)";
  88.     COLOR col: INPUT " [Enter] = 3 "; pet
  89.     IF pet < 1 THEN pet = 3
  90.     COLOR 15: PRINT "  Major axis (X-Axis)";
  91.     COLOR col: INPUT " [Enter] = 200 "; r(1)
  92.     COLOR 15: PRINT "  Minor axis (Z-Axis)";
  93.     COLOR col: INPUT " [Enter] = 200 "; r(2)
  94.     IF r(1) = 0 OR r(2) = 0 THEN r(1) = 200: r(2) = 200
  95.     COLOR 15: PRINT "  X-Offset from center";
  96.     COLOR col: INPUT " [Enter] = none "; Xoff
  97.     COLOR 15: PRINT "  Z-Offset from center";
  98.     COLOR col: INPUT " [Enter] = none "; Zoff
  99.     COLOR 15: PRINT "  How many FRAMES for this path";
  100.     COLOR col: INPUT " [Enter] = 120 "; num
  101.     IF num = 0 THEN num = 120
  102.     IF pet / 2 = INT(pet / 2) THEN 2000 ELSE 2010   'test for even or odd
  103.  
  104. 400 ' -----  Get data for LIMACON  -----
  105.      ShowGrid
  106.      LOCATE 19, 2
  107.      COLOR col: PRINT "LIMACON (loop):"
  108.      COLOR 15: PRINT "  Number of inner loops (1-5)";
  109.      COLOR col: INPUT " [Enter] = 1 "; lup
  110.      IF lup < 1 THEN lup = 1
  111.      COLOR 15: PRINT "  S)ingle or D)ouble limacon?";
  112.      COLOR col: INPUT " [Enter] = single "; t$
  113.      IF t$ = "" OR t$ = CHR$(13) THEN t$ = "SINGLE"
  114.      COLOR 15: PRINT "  Major axis (X-Axis)";
  115.      COLOR col: INPUT " [Enter] = 200 "; r(1)
  116.      COLOR 15: PRINT "  Minor axis (Z-Axis)";
  117.      COLOR col: INPUT " [Enter] = 200 "; r(2)
  118.      IF r(1) = 0 OR r(2) = 0 THEN r(1) = 200: r(2) = 200
  119.      COLOR 15: PRINT "  X-Offset from center";
  120.      COLOR col: INPUT " [Enter] = none "; Xoff
  121.      COLOR 15: PRINT "  Z-Offset from center";
  122.      COLOR col: INPUT " [Enter] = none "; Zoff
  123.      COLOR 15: PRINT "  How many FRAMES for this path";
  124.      COLOR col: INPUT " [Enter] = 120 "; num
  125.      IF num = 0 THEN num = 120
  126.      IF t$ = "s" OR t$ = "S" OR t$ = "single" OR t$ = "SINGLE" THEN 2020 ELSE 2030
  127.  
  128. 1000 ' -----  Draw CIRCLE or ELLIPSE  -----
  129.      IF r(1) = r(2) THEN path = 1 ELSE path = 2
  130.      ShowGrid
  131.      FOR theta = 0 TO 2 * pi STEP ((2 * pi) / num)
  132.        x = r(1) * COS(theta) + Xoff        ' basic polar coords. +/- X offset
  133.        Z = r(2) * SIN(theta) + Zoff        ' basic polar coords. +/- Y offset
  134.      LINE (x, Z)-(x + 1, Z + 1), col, B    ' draw bigger points than PSET can
  135.      NEXT theta
  136.      GOTO 5000
  137.     
  138. 2000 ' -----  Draw LEMNISCATE & LIMACON  ' Leaving b=1 and c=1 gives us
  139.        a = (pet / 2): B = 1: c = 1       ' an equation for a lemniscate:
  140.        e = 2: f = 1                      '
  141.       path = 4                           '  x = SIN(A*theta)*COS(theta) + Xoff
  142.       GOTO 2500                          '  y = SIN(A*theta)*SIN(theta) + Zoff
  143.                                          '
  144.                                          ' if A is odd, A = # of petals
  145. 2010   a = pet: B = 1: c = 1             '   and theta must make one half
  146.        e = 1: f = 2                      '   revolutions (from 0 to pi)
  147.       path = 3                           ' if A is even, 2*A = # of petals
  148.       GOTO 2500                          '   and theta must make one full
  149.                                          '   revolution (from 0 to 2*pi)
  150.  
  151. 2020   a = 1: B = 1: c = (lup * 2) + 1   ' Leaving a=1 and b=1 gives us
  152.        e = 1: f = 2                      ' an equation for a limacon:
  153.       path = 5                           '
  154.       GOTO 2500                          '  x = SIN(theta)*COS(C*theta) + Xoff
  155.                                          '  y = SIN(theta)*SIN(C*theta) + Zoff
  156.                                          '
  157. 2030   a = 1: B = 1: c = lup * 2         ' if C is odd, it's a single limacon
  158.        e = 2: f = 1                      '   with (C-1)/2 loops & a half rev.
  159.       path = 6                           ' if C is even, it's a double limacon
  160.       GOTO 2500                          '   with (C/2) loops & a full rev.
  161.                                          '
  162.                                        
  163. 2500 '   ------  MY (Polar) equation using a, b, and c  ------
  164.      '    Send different combinations of a, b, and c to this
  165.      '    equation to see the results. Basically, I've covered
  166.      '    the MAJOR ones (lemniscate and limacon), but you can alter
  167.      '    the general shape as well. This just one of a million
  168.      '    equations that will work - please experiment!
  169.      '    Note: the SIN(a*theta)'s could be COS(a*theata)'s...this just
  170.      '          determines it's orientation in space. (COS makes the
  171.      '          paths lay sideways on the screen instead of vertical)
  172.        ShowGrid
  173.        FOR theta = 0 TO e * pi STEP ((2 * pi) / num / f)
  174.           x = r(1) * SIN(a * theta) ^ B * COS(c * theta) + Xoff
  175.           Z = r(2) * SIN(a * theta) ^ B * SIN(c * theta) + Zoff
  176.        LINE (x, Z)-(x + 1, Z + 1), col, B
  177.        NEXT theta
  178.        GOTO 5000
  179.  
  180. 5000 LOCATE 27, 59
  181.      IF path = 1 THEN COLOR 11: PRINT "CIRCLE"
  182.      IF path = 2 THEN COLOR 14: PRINT "ELLPISE"
  183.      IF path = 3 THEN COLOR 10: PRINT "LEMNISCATE, ODD"
  184.      IF path = 4 THEN COLOR 10: PRINT "LEMNISCATE, EVEN"
  185.      IF path = 5 THEN COLOR 9: PRINT "LIMACON, SINGLE"
  186.      IF path = 6 THEN COLOR 9: PRINT "LIMACON, DOUBLE"
  187.      LOCATE 28, 59: COLOR 15: PRINT "SAVE this path? (Y/N)";
  188.      DO: save$ = INKEY$: LOOP WHILE save$ = ""
  189.      IF save$ = "Y" OR save$ = "y" THEN 5010 ELSE 20
  190.  
  191. 5010 ' -----  Save the current CamPATH to disk  -----
  192.      CLS : COLOR 14
  193.      PRINT "The current camera path is ready for output..."
  194.        COLOR 15
  195.        LINE (205, 220)-(320, 220): LINE -(320, 25)
  196.        LINE -(205, 25): LINE -(205, 220)
  197.      LOCATE 3, 2: INPUT "Name for the batch file (anim.bat)"; batch$
  198.        IF batch$ = "" THEN batch$ = "anim.bat"
  199.        COLOR 14: LOCATE 3, 68: PRINT batch$: COLOR 15
  200.      LOCATE 5, 2: INPUT "Name for the include file (campath.inc)"; incl$
  201.        IF incl$ = "" THEN incl$ = "campath.inc"
  202.        COLOR 14: LOCATE 5, 68: PRINT incl$: COLOR 15
  203.      LOCATE 7, 2: INPUT "Name of the datafile to animate (test.dat)"; file$
  204.        IF file$ = "" THEN file$ = "test.dat"
  205.        COLOR 14: LOCATE 7, 68: PRINT file$: COLOR 15
  206.      LOCATE 9, 2: INPUT "Name of the command definition file (trace.def)"; defi$
  207.        IF defi$ = "" THEN defi$ = "trace.def"
  208.        COLOR 14: LOCATE 9, 68: PRINT defi$: COLOR 15
  209.      LOCATE 11, 2: INPUT "Name of your executable file (dkb.exe)"; dkb$
  210.        IF dkb$ = "" THEN dkb$ = "dkb.exe"
  211.        COLOR 14: LOCATE 11, 68: PRINT dkb$: COLOR 15
  212.      LOCATE 13, 2: INPUT "Up to 4 letters for the TGA output files (anim)"; tga$
  213.        IF tga$ = "" THEN tga$ = "anim"
  214.        COLOR 14: LOCATE 13, 68: PRINT tga$ + "0000.tga"
  215.        LOCATE 15, 1
  216.        PRINT "(C)reate CamPATH batch file, (R)e-enter names, or (Q)uit "
  217. 5020   k$ = INKEY$: IF k$ = "" THEN 5020
  218.        IF (k$ = "C" OR k$ = "c" OR k$ = CHR$(13)) AND path <= 2 THEN 5500
  219.        IF (k$ = "C" OR k$ = "c" OR k$ = CHR$(13)) AND path >= 3 THEN 5520
  220.        IF k$ = "R" OR k$ = "r" THEN 5010
  221.        GOTO 20
  222.  
  223. 5500 ' -----  Create batch file for CIRCLE or ELLIPSE  -----
  224.      frm = 1
  225.      ShowGrid
  226.      COLOR 15: LOCATE 29, 1
  227.      PRINT "Opening "; batch$; ": Inserting data...";
  228.      OPEN batch$ FOR OUTPUT AS #1
  229.      PRINT #1, "@ECHO OFF"
  230.      PRINT #1, "cls"
  231.      PRINT #1, "echo This CamPATH batch file will render"; num; "frames of "; file$; "."
  232.      PRINT #1, "echo."
  233.      PRINT #1, "echo Be sure to INCLUDE "; CHR$(34); incl$; CHR$(34); " in your "; file$; " file,"
  234.      PRINT #1, "echo and insert the XPOS and ZPOS varaibles into your camera's LOCATION statement."
  235.      PRINT #1, "echo."
  236.      PRINT #1, "echo This batch file uses "; defi$; " for resolution, quality, etc."
  237.      PRINT #1, "echo and will save the frames as "; tga$ + "0001.tga through "; tga$; FrameFix(num); ".tga."
  238.      PRINT #1, "echo."
  239.      PRINT #1, "echo Press CTRL-C to abort, or"
  240.      PRINT #1, "PAUSE"
  241.      FOR theta = 0 TO (2 * pi) STEP ((2 * pi) / num)
  242.         PRINT #1, ""
  243.         PRINT #1, "rem  --- FRAME #"; frm; "---"
  244.           x = r(1) * COS(theta) + Xoff
  245.           Z = r(2) * SIN(theta) + Zoff
  246.           LINE (x, Z)-(x + 1, Z + 1), col, B
  247.         IF x > -.001 AND x < .001 THEN x = 0      ' Keeps negative exponents
  248.         IF Z > -.001 AND Z < .001 THEN Z = 0      ' out of the include file
  249.         PRINT #1, "echo DECLARE XPOS ="; x; "> "; incl$
  250.         PRINT #1, "echo DECLARE ZPOS ="; Z; ">> "; incl$
  251.         PRINT #1, dkb$; " -i"; file$; " -o"; tga$ + FrameFix$(frm) + ".tga "; defi$
  252.         frm = frm + 1
  253.         IF frm > num THEN CLOSE #1: GOTO 6000  '<-- This is SLOPPY but it
  254.      NEXT theta                                ' insures that there will be
  255.      CLOSE #1                                  ' exactally the correct
  256.      GOTO 6000                                 ' number of frames.
  257.  
  258. 5520 ' -----  Create batch file for LEMNISCATE or LIMACON  -----
  259.      frm = 1
  260.      ShowGrid
  261.      COLOR 15: LOCATE 30, 1
  262.      PRINT "Opening "; batch$; ": Inserting data...";
  263.      OPEN batch$ FOR OUTPUT AS #1
  264.      PRINT #1, "@ECHO OFF"
  265.      PRINT #1, "cls"
  266.      PRINT #1, "echo This CamPATH batch file will render"; num; "frames of "; file$; "."
  267.      PRINT #1, "echo."
  268.      PRINT #1, "echo Be sure to INCLUDE "; CHR$(34); incl$; CHR$(34); " in your "; file$; " file,"
  269.      PRINT #1, "echo and insert the XPOS and ZPOS varaibles into your camera's LOCATION statement."
  270.      PRINT #1, "echo."
  271.      PRINT #1, "echo This batch file uses "; defi$; " for resolution, quality, etc."
  272.      PRINT #1, "echo and will save the frames as "; tga$ + "0001.tga through "; tga$; FrameFix(num); ".tga."
  273.      PRINT #1, "echo."
  274.      PRINT #1, "echo Press CTRL-C to abort, or"
  275.      PRINT #1, "PAUSE"
  276.      FOR theta = 0 TO (e * pi) STEP ((2 * pi) / num / f)
  277.         PRINT #1, ""
  278.         PRINT #1, "rem  --- FRAME #"; frm; "---"
  279.           x = r(1) * SIN(a * theta) ^ B * COS(c * theta) + Xoff
  280.           Z = r(2) * SIN(a * theta) ^ B * SIN(c * theta) + Zoff
  281.           LINE (x, Z)-(x + 1, Z + 1), col, B
  282.         IF x > -.001 AND x < .001 THEN x = 0      ' Keeps negative exponents
  283.         IF Z > -.001 AND Z < .001 THEN Z = 0      ' out of the include file
  284.         PRINT #1, "echo DECLARE XPOS ="; x; "> "; incl$
  285.         PRINT #1, "echo DECLARE ZPOS ="; Z; ">> "; incl$
  286.         PRINT #1, dkb$; " -i"; file$; " -o"; tga$ + FrameFix$(frm) + ".tga "; defi$
  287.         frm = frm + 1
  288.         IF frm > num THEN CLOSE #1: GOTO 6000  ' <--- You see, just getting
  289.      NEXT theta                                '  the loop to end at one step
  290.      CLOSE #1                                  '  less than (e*pi) IS NOT
  291.      GOTO 6000                                 '  good enough. This is BAD,
  292.                                                '  but it IS cheap insurance.
  293. 6000 saved = 1: GOSUB 9000
  294.      LOCATE 5, 10: COLOR 14, 0
  295.      PRINT ; "The file "; batch$; " has been created in the current directory."
  296.      PRINT : COLOR 15, 0
  297.      PRINT "1. Edit your datafile ("; file$; "), inserting the line INCLUDE "; CHR$(34); incl$; CHR$(34); ","
  298.      PRINT "    and substitute XPOS and ZPOS into your camera's LOCATION command."
  299.      PRINT "    (ie. LOCATION <XPOS 70 ZPOS> where 70 is some fixed height of the path.)"
  300.      PRINT "    Also, be sure that your LOOK_AT is aimed at the 'main part' of the scene."
  301.      PRINT
  302.      PRINT "2. Edit your definition file ("; defi$; ") so it's set up for THIS animation."
  303.      PRINT "    ("; dkb$; " will look there for resolution, quality, etc. for all frames.)"
  304.      PRINT
  305.      PRINT "3. Move "; batch$; " into your raytrace directory and execute it..."
  306.      PRINT "    it will render all"; num; "frames of "; file$; " automatically, and"
  307.      PRINT "    save each in targa format, starting with "; tga$ + "0001.tga"
  308.      PRINT : COLOR 7, 0
  309.      GOTO 9999
  310.  
  311. 7000  ' -------- ABOUT CamPATH ---------
  312.       CLS : COLOR 14
  313.       LOCATE 1, 34: PRINT "CamPATH v1.0"
  314.       LOCATE 2, 31: PRINT "By: John Hammerton"
  315.       LOCATE 4, 17: PRINT CHR$(34); "This is your CAMERA on drugs, any questions?"; CHR$(34)
  316.       LOCATE 6, 1: COLOR 7
  317.       PRINT "   CamPATH was inspired from an earlier program of mine called Rotate, which"
  318.       PRINT "simply incremented one variable for DKB's ROTATE command in the VIEW_POINT"
  319.       PRINT "declaration by a certain number of degrees. DKB's ROTATE command makes these"
  320.       PRINT "circular paths VERY simple to implement - but after a good number of animations"
  321.       PRINT "simply rotating the camera about a fixed radius isn't enough."
  322.       PRINT
  323.       PRINT "   Instead of using the ROTATE command, CamPATH solves a set of equations"
  324.       PRINT "for XPOS and ZPOS (the X and Z position of the camera's LOCATION.) These"
  325.       PRINT "equations are converted from the Polar Coordinate system and include"
  326.       PRINT "the Ellipse, the Lemniscate (rose), the Limacon (loop) and the good old Circle."
  327.       PRINT
  328.       PRINT "   CamPATH asks you for your input on size, shape and number of points (frames)"
  329.       PRINT "and gives you a preview of the path. Each point represents the actual"
  330.       PRINT "position of the camera from frame to frame. You can then SAVE this data as"
  331.       PRINT "a batch file, which will render all of the frames for you, automatically."
  332.       PRINT
  333.       PRINT "   Disclaimer: CamPATH v1.0 does NOT have a delete function and could only harm"
  334.       PRINT "an existing file if it saves 'over' it with the same name. It also can NOT"
  335.       PRINT "access any file except for the batch file it creates. (ie. it can't alter your"
  336.       PRINT "data or definition files) It allows YOU to name all files involved with the"
  337.       PRINT "process so there's no mix-ups. Therefore, I cannot be held liable for any"
  338.       PRINT "damages resulting from the use or misuse of this program."
  339.       LOCATE 30, 1: COLOR 14
  340.       PRINT "Press any key to continue...or <ESC> to Begin";
  341. 7010  k$ = INKEY$: IF k$ = "" THEN 7010
  342.       IF k$ = "B" OR k$ = "b" OR k$ = CHR$(27) THEN 20
  343.      
  344.       CLS : COLOR 14
  345.       LOCATE 1, 34: PRINT "CamPATH v1.0"
  346.       LOCATE 2, 31: PRINT "By: John Hammerton"
  347.       LOCATE 4, 1: COLOR 7
  348.       PRINT "   CamPATH v1.0 moves the camera using the XPOS and ZPOS variables asuming your"
  349.       PRINT "datafile uses Y as the UP direction - but since YOU have to put these into"
  350.       PRINT "your LOCATION command by hand, you could just as easily swap them around for"
  351.       PRINT "a different cooridinate system (or for a vertical path, for example)."
  352.       PRINT
  353.       PRINT "   Be sure your LOOK_AT command is set appropriately because the camera will"
  354.       PRINT "look right at THAT point the ENTIRE length of the animation, no matter where"
  355.       PRINT "the camera path goes. With complex scenes this decision can take some figuring."
  356.       PRINT
  357.       PRINT "   If your camera path passes very close to or through objects in your scene,"
  358.       PRINT "unwanted effects can occur, like suddenly jumping INSIDE of a sphere that you"
  359.       PRINT "meant to pass by or moving INTO a plane which blocks your view of the scene for"
  360.       PRINT "a number of frames. The best way to aviod this is to begin an animation idea"
  361.       PRINT "with FIRST designing the path, INCLUDING AN OFFSET...and THEN start to build"
  362.       PRINT "the datafile around the (0,0) spot, assuming your LOOK_AT is (0,0). Failure to"
  363.       PRINT "offset the path, especially with lemniscates and limacons, can make a mess."
  364.       PRINT
  365.       PRINT "  CamPATH v1.0 is a toy. It is just the first few bits of an animation designer"
  366.       PRINT "that may have some potential down the road. CamPATH v2.0 is well on the way and"
  367.       PRINT "it will have a more informative interface (perhaps a little gooey), it will"
  368.       PRINT "support a YPOS as well for more Freedom of Path and some new 3D path types,"
  369.       PRINT "and v2.0 will have a less limiting way of picking the actual SIZE of the path."
  370.       PRINT
  371.       PRINT "  Enjoy! It DOES add a needed dimention (or two) to animations. PLEASE drop me"
  372.       PRINT "a message on YCCMR with your ideas and suggestions for v2.0 and beyond."
  373.       LOCATE 30, 1: COLOR 14
  374.       PRINT "Press any key to Begin";
  375. 7020  k$ = INKEY$: IF k$ = "" THEN 7020
  376.       GOTO 20
  377.  
  378. 9000  SCREEN 0: WIDTH 80: COLOR 7, 0
  379.       FOR wipe = 1 TO 25: LOCATE wipe, 1: PRINT SPC(79); " "; : NEXT wipe
  380.       COLOR 15, 4
  381.       LOCATE 1, 30: PRINT "    CamPATH v1.0    "
  382.       LOCATE 2, 30: PRINT " By: John Hammerton "
  383.       LOCATE 3, 30: PRINT "      09/17/91      "
  384.       COLOR 7, 0
  385.       IF saved = 1 THEN RETURN
  386.  
  387. 9999  END
  388.  
  389. FUNCTION FrameFix$ (frm AS SINGLE)                ' This function takes the
  390.      frame$ = (STR$(frm))                         ' input variable, (in this
  391.      fix$ = RIGHT$(frame$, LEN(frame$) - 1)       ' case, our frame number)
  392.      IF frm < 10000 THEN FrameFix$ = fix$         ' chops the leading space
  393.      IF frm < 1000 THEN FrameFix$ = "0" + fix$    ' away, and attaches the
  394.      IF frm < 100 THEN FrameFix$ = "00" + fix$    ' correct number of zeroes
  395.      IF frm < 10 THEN FrameFix$ = "000" + fix$    ' for easy post-processing.
  396. END FUNCTION
  397.  
  398. SUB ShowGrid
  399.   
  400.    CLS
  401.      FOR Grid = -300 TO 300 STEP 50
  402.        IF Grid = 0 THEN gc = 12 ELSE gc = 8
  403.        LINE (Grid, 200)-(Grid, -200), gc
  404.        LINE (-300, Grid)-(300, Grid), gc
  405.      NEXT Grid
  406.    COLOR 15
  407.      LOCATE 15, 38: PRINT "(0,0)";      ' center   To keep things simple,
  408.      LOCATE 3, 37: PRINT " +200 ";      ' top      for now I'm using the
  409.      LOCATE 15, 1: PRINT "-300 ";       ' left     individual VGA pixels
  410.      LOCATE 15, 75: PRINT " +300";      ' right    as an unscaleable
  411.      LOCATE 28, 37: PRINT " -200 ";     ' bottom   unit of measure.
  412.      LINE (-2, -2)-(2, 2), 14, BF       '          (this will be changed)
  413.    COLOR 12
  414.      LOCATE 2, 41: PRINT "Z"
  415.      LOCATE 16, 79: PRINT "X"
  416.  
  417. END SUB
  418.  
  419.