home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / graphics / trans4.zip / TRANS4.DOC < prev    next >
Text File  |  1993-07-03  |  23KB  |  491 lines

  1. TRANS4.DOC 7/3/93
  2.  
  3.                            TRANS4 Version 1.1
  4.  
  5. ********************** NOTICE *********************************************
  6.  
  7. TRANS4 v1.1 is a FREE, copyrighted program.  Feel free to distribute the ZIP
  8. as you see fit.  Keep in mind that there is NO support, and that you use this
  9. product AT YOUR OWN RISK!!!
  10.  
  11. TRANS4 copyright (c) 1993, Lyn Ratcliff
  12.  
  13. ***************************************************************************
  14.  
  15.  
  16. TRANS4 1.1 Quick Reference
  17.  
  18. What is TRANS4?
  19.  
  20. TRANS4 is an interactive graphics demonstration program which displays
  21. colorful, animated 4-dimensional wireframe objects on the IBM compatible
  22. personal computer. TRANS4 allows you to choose display characteristics of
  23. these objects, including motion rates and colors.
  24. TRANS4 has a number of figure types which you can modify to your liking,
  25. and the ability to display 4-dimensional figures that you create using
  26. instructions in a standard text file.
  27.  
  28. SYSTEM REQUIREMENTS:
  29.  
  30. To use TRANS4, you'll need an IBM AT compatible computer with color VGA
  31. graphics, and a math coprocessor (287 or 387) or fully functioning 486 CPU.
  32. TRANS4 will function on a VGA graphics capable system without a math
  33. coprocessor, but VERY SLOWLY!
  34.  
  35. An ASCII (plain text) editor is required if you wish to create your own figures.
  36.  
  37. FILE TYPES:
  38.  
  39. TRANS4 uses two file types, with the extensions .TR4 or .YF4.  The .TR4 files,
  40. such as DEFAULT.TR4, contain information written by TRANS4 when you save a
  41. color scheme from within TRANS4.  The .YF4 files are examples of figures that
  42. you can create yourself.
  43.  
  44. RUNNING TRANS4:
  45.  
  46. Simply type TRANS4 at the DOS prompt in the TRANS4 directory.  This takes you
  47. to the entry screen.  At the top of the screen are instructions for cursor
  48. movement from the keyboard.  Below the instructions is a key of the 16 colors
  49. available to you, labeled from 0 to F.  Immediately below the color key are the
  50. line colors, which may be changed by the use of the arrow keys.  There is a red
  51. marker on the left which indicates which parameter field is currently active
  52. for change.  In the bottom right corner of the screen is a preview of the
  53. figure.  Press the ENTER key to see the full screen display, and then any key
  54. to return to the entry screen.
  55.  
  56. Now press the PAGE DOWN key to move to the "...projections..." field (the red
  57. indicator will move as well) and use the four arrow keys to change this value.
  58. Note what happens in the corner display!  Okay, change it back to 1 and press
  59. PAGE DOWN again.
  60.  
  61. The next four fields control the rotation rates in the body-centered axes.  Go
  62. ahead and change these around.
  63.  
  64. Now page down to the Figure Type field, and use the up or down arrows to scroll
  65. through the various figures. Note that the Hypercube and Octahedra figure types
  66. have color editing capability (in the Line Colors field); feel free to page
  67. back up and change or blank out some or all of them!  The remaining figure
  68. types are randomly generated, so there is no line color editing available for
  69. them.  Press ENTER at any time to see the full screen display.
  70.  
  71. You can save any changes you make to the Hypercube and Octahedra figures when
  72. you exit TRANS4.  From the entry screen, press ESCAPE and then enter y to the
  73. "save" prompt. Then enter a one to eight character filename, such as MYCOLORS,
  74. then press ENTER. Your parameters will be saved in a file named MYCOLORS.TR4.
  75. To load your file, simply type TRANS4 MYCOLORS.TR4 at the DOS prompt.  There
  76. are a number of sample .TR4 files included with the program.
  77.  
  78. INTERLUDE:
  79.  
  80. To get an idea of what TRANS4 can do very easily in an automated demo
  81. mode, from the DOS command line simply type DEMO or TRANS4 DEMOTR4.BAT.
  82.  
  83. TRANS4 will "play" the file DEMOTR4.BAT as a sequence of timed displays, moving
  84. smoothly from figure to figure (this is best from a hard disk).  Press any key
  85. to skip a display, and press F3 to exit the demo.
  86.  
  87. MAKE YOUR OWN FIGURES:
  88.  
  89. You may have noticed some unusual figures as you watched the demo.  These were
  90. loaded from .YF4 files.  To make your own figures, use a text editor to modify
  91. a copy of one of the existing .YF4 files.  Instructions are towards the end of
  92. this document.
  93.  
  94. BATCH/DEMO MODE:
  95.  
  96. String your favorite figures together for an eye-catching display!  TRANS4
  97. can be called from within a batch file, one example DEMOTR4.BAT is included
  98. with the distribution disk.  Typing DEMOTR4.BAT will cause this batch file to
  99. run TRANS4 once for every line in the DEMOTR4.BAT file.  This file makes
  100. extensive use of command line options, which are described on the later.
  101.  
  102. You can create your own sequence of displays and collect them in a .BAT file of
  103. your own choosing, such as MYDEMO.BAT.  Use TRANS4 to play this file as a
  104. continuous loop by the command TRANS4 MYDEMO.BAT.  The filetype MUST be .BAT
  105. with version 1.1.
  106.  
  107. COMMAND LINE OPTIONS:
  108.  
  109. For greater control over the motion of figures, TRANS4 accepts instructions
  110. from the command line used to invoke the program.  These commands may be used
  111. to override any of the parameters set in the .TR4 or .YF4 files except for
  112. line colors.  Use command line options to skip entry screens, file saving
  113. screens, or set time limits on displays.  Options consist of the backslash
  114. character / followed by one of the characters in the table below.  For those
  115. options which pass a value to TRANS4, the value should immediately follow the
  116. instruction without spaces inbetween.  (Note: I believe this requirement is no
  117. longer necessary)  Examine the file DEMOTR4.BAT for examples of the use of
  118. command line options.  All distance values are in units of pixel width.  Do
  119. not use commas in your values; i.e. use 1027 rather than 1,027.
  120.  
  121. Note that the following group consists of mostly lower-case letters.  Use of
  122. upper case letters will be explained after the list.
  123.  
  124. /a  Skip the parameter entry screen and go directly to the display screen.
  125.     This option is useful when stringing timed displays together with /t in
  126.     demo mode.  Takes no values.
  127.  
  128. /b  Skip the save screen and exit.  This option is useful  in demo mode.
  129.     Takes no values.
  130.  
  131. /e  Sets the number of replications to draw before erasing.  Ex.: /e27 will
  132.     draw the figure for 27 rotations before starting to erase the old
  133.     replications.  Values above 200 will be adjusted to 200.
  134.  
  135. /f  Sets the figure type when loading a .TR4 file.  F=0 for the hypercube, f=1
  136.     for the octahedron, f=2 for potluck, f=3 for odd potluck, and f=4 for
  137.     PotSym 8.
  138.  
  139. /i  Rotate the figure relative to the rotation axis prior to animation.  For
  140.     instance, /i45/j55 will set the hypercube on a corner so that it spins
  141.     around a diagonal axis. The value passed to TRANS4 is the angle in degrees.
  142.  
  143. /j,/k,/l  Similar to /i, but for the other three angles.  Order is the same as
  144.     listed in the entry screen.
  145.  
  146. /m  Sets the distance to which the figure will retreat, relative to the screen.
  147.  
  148. /n  Sets the distance to which the figure will approach.  TRANS4 will not allow
  149.     values less than 250 minus the viewing distance (see /v below).
  150.  
  151. /o  Alternate rotation for the 3rd rotation.  The default rotations are:
  152.     rotation in xz plane, then xy, xw, and xz planes, where these planes are
  153.     fixed relative to the body of the figure AFTER the initial rotations
  154.     carried out by the /i,j,k,l options.  The /o option replaces the xw
  155.     rotation by a zw rotation.  Many people prefer to use this option.
  156.  
  157. /p  Sets the zoom rate.
  158.  
  159. /t  Sets a timer for dislay.  If /b is specified, TRANS4 ends after time is up;
  160.     otherwise a new figure is generated.  Use this option in demo mode with
  161.     /a/b, or with /f2, 3, or 4 to generate a new figure without leaving
  162.     display mode.  Values are in seconds.
  163.  
  164. /u  With this option, replications are updated offscreen and displayed only
  165.     after each new replication is finished.  Useful if you intend to pause the
  166.     program and examine or capture the screen.  Speed, resolution,  and sense
  167.     of motion are degraded if this option is set.
  168.  
  169. /v  Sets the viewing distance from the screen used to calculate perspective.
  170.     The default is 800;  the minimum allowed is 250.  The use of the default
  171.     results in exagerated perspectives, so purists may wish to overide this
  172.     value; this will require an adjustment (down) in /n /m values to maintain
  173.     apparent figure size.  For proper perspective, calculate pixel size:  for
  174.     example, the TRANS4 display is 640 pixels wide; if your VGA display has an
  175.     illumination width of 9 inches, then there are 640/9 or 71 pixels/inch.
  176.     To view a proper perspective from a distance of 20 inches, then 20*71=1420
  177.     is the number to use, i.e. /v1420.  Maximum is 5000.
  178.  
  179. /w,/x,/y,/z  Overides the angle incrementation rates of rotations.   The
  180.     rotation sequence is described above in the /o option discussion,
  181.     i.e. /w in xz plane for angle phi, /x in xy plane for theta, /y in xw or
  182.     zw plane for eta, and /z in xz plane for psi.
  183.  
  184. /*  Cycle the diplayed colors.  This will do some peculiar things on some .TR4
  185.     f=0,1 figures, though.
  186.  
  187. /&  Cycle the pallete after each set of replications defined by /e.
  188.  
  189. SPICE:
  190.  
  191. Upper case letters may be used as well.  BUT,
  192.  
  193. use of E, I-N, P, and W-Z will result in the supplied number being replaced by
  194. a randomly generated number on the interval of 1/2 to 3/2 times the number you
  195. supplied.  This works well with /a/b/t, so that you don't get the same
  196. orientation of the figures every time the figure is displayed with a timer.
  197.  
  198. ALSO, if you input a negative number, then the use of these capitalized /
  199. options will return a 50/50 chance of a +/- value being returned (actually a
  200. 100% chance of a positive or negative number).
  201.  
  202. /F will randomly select one of the figures.
  203.  
  204. EXAMPLES:
  205.  
  206. TRANS4 /A/b/T15/E8/F2/I-60/J-60/K-60/L-60/M700/P27/W-250/X-250/Y-250/Z-250
  207.  
  208. Type this at the command line, hit return, and you'll see a variety of things.
  209. This is somewhat busy on a 386/7DX40, and frantic on a fast 486.  Raise/lower
  210. the W-Z values if you have a slow/fast computer.
  211.  
  212. Command line flags may be added when playing a .BAT file as well, overriding
  213. the options used in the .BAT file, i.e.
  214.  
  215.        TRANS4 play.bat /& /W-800/X-1800/Y-900/Z-300
  216.  
  217. This will speed things up a bit.
  218.  
  219. FUNCTION KEYS:
  220.  
  221. F3     Get out fast.
  222. F4     Toggle which turns the zoom on/off.
  223. F5-8   Toggle for the four rotations, on/off.
  224.  
  225.  
  226. CREATING YOUR OWN FIGURES:
  227.  
  228. To create figures of your own design, you will need a text editor that has
  229. the capability to save plain (ASCII) text files.  Most operating systems come
  230. with such a text editor; see the operating system manuals for details on the
  231. correct usage if you are unfamiliar with your particular editor.  The editor
  232. supplied with DOS 4.0, accessed via the DOSSHELL command, and the Microsoft
  233. Windows 3.0 accessories editor are both suitable for this task.
  234.  
  235. TRANS4 is able to read text files containing data which may be used to
  236. construct a figure.  Such files are required to conform to a specific format
  237. for TRANS4 to be successful in correctly interpreting the data.  For this
  238. reason, we STRONGLY recommend that all active applications containing data which
  239. could conceivably be lost be terminated before attempting to run an untested
  240. .YF4 file with TRANS4.  For instance, while TRANS4 will run successfully in
  241. the DOS box of Windows or OS/2, it would be prudent to exit Windows or boot to
  242. DOS before testing a new .TR4 file.  No problems, such as system hangs, have
  243. been reported as of yet, but as it is impossible to predict all of the many
  244. types of file formats that might conceivably be fed to the program we can never
  245. claim to have tested TRANS4 under every condition.  (we tried, though!)
  246.  
  247. There are a couple of instances in which TRANS4 will display something that
  248. you did not expect: if TRANS4 does not find the file you specified on the
  249. command line it will automatically load the default .TR4 file DEFAULT.TR4.
  250. This is usually not too traumatic.  The other instance is when the format of
  251. the .YF4 file is other than expected, in which case TRANS4 may not appear to
  252. respond to the usual keypresses.  Should this happen, exit the program by
  253. pressing the F3 key and examine your .YF4 file.  The usual problem is that
  254. TRANS4 did not find:
  255.  
  256.         The right number of pieces of data on a line
  257.         The right number of commas (used to separate data) on a line
  258.         more or fewer POINTS defined than specified
  259.         more or fewer LINES defined than specified
  260.  
  261. TYPICALLY, PRESSING F3 WILL GET YOU OUT OF ANY TROUBLE within the program.
  262.  
  263. Okay, hope we haven't scared any-one off!
  264.  
  265. The best way to create a figure is to copy and edit one of the .YF4 files
  266. which came with your distribution diskette.  They also serve as examples.
  267. To copy a file, enter the following at the DOS prompt in the TRANS4 directory:
  268.  
  269.         COPY HYPRCUBE.YF4 MYFIG.YF4
  270.  
  271. Then open MYFIG.YF4 with your editor.
  272.  
  273. The rules for describing a figure are not very complicated.  TRANS4 expects
  274. every line in the file to start with a description, which can be as long or
  275. as short as you wish, but it must be present.  The description is a string of
  276. letters or characters which contain no commas or spaces.  Commas are used to
  277. separate the pieces of data or numbers that are the instructions for TRANS4.
  278. The decription is considered a piece of data (although it is ignored by TRANS4)
  279. and so every description should have a comma after it except for the first
  280. line, which is the name of your figure.
  281.  
  282. The format of the .YF4 file is as follows:
  283.  
  284. 1st line: The name of your figure
  285.  
  286.           eg: Buncha???
  287.  
  288. 2nd line: The coordinates that your figure is centered on.
  289.  
  290.           eg: Coordinates, 0, 0, 0, 0
  291.  
  292.           These correspond to x, y, z, w values.  TRANS4 uses w to represent
  293.           the location in the fourth dimension of the figure.  Currently,
  294.           TRANS4 does not use all of this information; it is present to
  295.           maintain compatibility with future versions of TRANS4, so you don't
  296.           need to change this line but it must be present.
  297.  
  298. 3rd line: The number of points to which lines will be drawn.
  299.  
  300.           eg: Number.of.points, 4
  301.  
  302.           After reading this number, TRANS4 will expect the coordinates for
  303.           these four points, i.e. their x, y, z, w values.  The coordinates
  304.           are listed on separate lines, so in this example TRANS4 expects four
  305.           additional text lines with coordinate values.
  306.  
  307. 4th line: First of the sets of coordinates in the order x, y, z, w.
  308.  
  309.           eg: First_point 200, 0, 0, 0
  310.  
  311.           then the remaining coordinates
  312.  
  313.               Secondpoint 0, -200, 0, 0
  314.               third.of.four 0, 0, 75, 150
  315.               lastpointofall 0, 0, 0, -99
  316.  
  317. Next(5+): The number of colored lines drawn connecting the points
  318.  
  319.           eg: Draw.this_manyLines, 4
  320.  
  321.           Again, once this number is read TRANS4 will expect this many text
  322.           lines to follow with instructions on which points to connect and
  323.           the color of the lines.
  324.  
  325. Next(6+): First of the Line Instructions
  326.  
  327.           eg: Line.number.one.connects.point1_to_point2_yellow, 1, 2, 14
  328.  
  329.               two.three.Blue, 2, 3, 9
  330.               three.four.White, 3, 4, 15
  331.               fourToOneRed, 4, 1, 12
  332.  
  333.           The three values correspond to 1) the number of the point on which
  334.           the line starts, as determined by the sequence of points as listed
  335.           above, 2) the number of the point to which the line will be drawn
  336.           and 3) the color of the line.
  337.  
  338.           The color of the line is determined by a number from 0 to 15.  These
  339.           colors are displayed on the entry screen in TRANS4 directly under the
  340.           instructions for cursor movement, and are labeled 0 (Black) to F
  341.           (bright white).  One must use the numerical value which corresponds
  342.           to the letter: A=10, B=11, C=12, D=13, E=14, and F=15.
  343.  
  344.           0  BLACK       4  RED           8  GRAY             12  LIGHT RED
  345.           1  BLUE        5  MAGENTA       9  LIGHT BLUE       13  LIGHT MAGENTA
  346.           2  GREEN       6  BROWN        10  LIGHT GREEN      14  LIGHT YELLOW
  347.           3  CYAN        7  WHITE        11  LIGHT CYAN       15  BRIGHT WHITE
  348.  
  349. Next(7+): Number of replications to draw before erasing
  350.  
  351.           eg: Replications, 12
  352.  
  353.           This is the number which corresponds to, and can be overridden by,
  354.           the /e command line option.  It appears in the text entry screen,
  355.           and from there can be changed interactively (but not saved).
  356.  
  357. Next(8+): Incrementation rates for the four angles; phi, theta, eta, psi
  358.  
  359.           eg: AngleRates, -67, 127, 876, 142
  360.  
  361.           These are the values that can be overridden by the /w, /x, /y, and
  362.           /z command line options.  They appear in the entry screen as well,
  363.           where they may be modified (but not saved) from the entry screen.
  364.  
  365. Next(9+): Maximum Distance to which the figure will retreat relative to the
  366.           screen location.  This value is typically positive (greater than
  367.           zero) for instances in which the figure would be "behind" the VGA
  368.           screen, or further away from the viewer than the surface of the
  369.           screen... although technically that direction is defined to be
  370.           in the direction of decreasing (negative) values on the Z axis
  371.           (see discussion on COORDINATE SYSTEM below).  Values are in units
  372.           of pixel-width.  So, if you want the figure to "shrink" as it
  373.           moves to a distance of two feet behind the screen, try
  374.  
  375.           eg: MaxDistance, 1700
  376.  
  377.           See the discussion on the /m command line option for more details.
  378.  
  379. Next(10+): Minimum Distance to which the figure will approach.  This number
  380.            can be negative, corresponding to a distance between the viewer
  381.            and the screen.  The /n command line option overrides this.  As
  382.            noted just above, this corresponds to a POSITIVE z value.
  383.  
  384.            eg: MinDistance, -500
  385.  
  386. Next(11+): Zoom Rate.  The larger the number, the faster the zoom rate.
  387.            The /p command line option overrides this value.
  388.  
  389.            eg: Zoom, 27
  390.  
  391. Next(12+): Viewing distance (in pixel-widths).  This value is used to determine
  392.            the proper perspective.  Large values will result in little
  393.            perceivable perspective (shrinking of the portion of the figure
  394.            furthest from view) and very small values will result in an
  395.            exagerated perspective.  The absolute minimum TRANS4 will allow is
  396.            250; smaller values will be adjusted upward to 250.  The default is
  397.            800, which slightly exagerates the perspective for most normal
  398.            viewing distances, but aids in providing a discernable depth cue.
  399.            This value may also be overridden with the /v command line option.
  400.  
  401.            It is included in order to maintain compatibility with future
  402.            versions of TRANS4.
  403.  
  404.            eg: View_Distance, 800.
  405.  
  406. Last(13+): Initial angles.  These are angles that the figure is rotated PRIOR
  407.            to being set in motion.  In other words, you can change the
  408.            orientation of an object before it starts spinning.  As an example,
  409.            try both of the following commands from the DOS prompt
  410.  
  411.                 TRANS4 3DEFAULT.TR4 /i0 /j0    /w500 /x0 /y0 /z0
  412.                 TRANS4 3DEFAULT.TR4 /i45 /j55  /w500 /x0 /y0 /z0
  413.  
  414.            In the first instance a cube, initially resting as though on a
  415.            flat surface, will begin to spin on its vertical axis (because
  416.            of the /w500 option).  In the second instance, the cube is rotated
  417.            so that it sits on a corner prior to spinning on the vertical axis.
  418.  
  419.            eg: InitialAngles, 45, 55, 0, 0
  420.  
  421.            Values are in degrees.  The /i, /j, /k, and /l command line options
  422.            will override these values.
  423.  
  424.            NOTE: If the /o command line option is set, it applies to both
  425.            initial rotations and motion.
  426.  
  427.            This is the last line in the file.
  428.  
  429.  
  430. FIGURE SIZES AND OTHER CONSIDERATIONS
  431.  
  432. As a general rule, figures should be sized so that they fit into a space that
  433. does not exceed 250 or so in any direction (viz. between -250 and 250).  The
  434. screen resolution, or "graininess", will not allow enough detail to be revealed
  435. to justify larger numbers, at least for your first figures.  In order to allow
  436. flexibility, TRANS4 will accept numbers larger in magnitude, but the figure
  437. should NOT be allowed to approach too closely; TRANS4 checks for most instances
  438. that would cause an overload (overflow) and so you should not run into trouble;
  439. if such an instance occurs TRANS4 will kick you out of the program and display
  440. an OVERFLOW message.
  441.  
  442. Secondly, remember that all rotations will occur around axes which pass through
  443. the origin (0, 0, 0, 0) and so plan accordingly.  Most of the sample .YF4 files
  444. have figures which are centered on the origin; ROCKET.YF4 is an example of a
  445. file with a figure which is not.
  446.  
  447.  
  448. USAGE
  449.  
  450. To load a .YF4 file, type TRANS4 followed by the filename and then any command
  451. line options; then press ENTER.
  452.  
  453.  
  454. COORDINATE SYSTEM
  455.  
  456. The coordinate system is set up such that the screen is the X,Y plane, with
  457. X positive to the right, negative to the left, and Y is positive up.  Z is
  458. positive from the screen to the viewer, and negative behind the screen.  Thus,
  459. the origin (0, 0, 0, 0) is located in the center of the screen.
  460. And W? Good question!
  461.  
  462.  
  463. THREE DIMENSIONAL FIGURES
  464.  
  465. If you wish to construct 3-D figures, simply set the w coordinate values to
  466. zero in the coordinate sets.  Using the command line options /k0 /y0 will
  467. keep the figure from "squashing" by eliminating the rotations into the fourth
  468. dimension.  Of course, you may prefer to see them squashed.  See OCTAHED3.YF4,
  469. for example.
  470.  
  471.  
  472. DON'T BE AFRAID!
  473.  
  474. If you come up with some really great .YF4 files, don't be afraid to share them
  475. with your friends; post them on your friendly neighborhood electronic bulletin
  476. board!  And let us know where all the good collections are...
  477.  
  478. ENJOY!
  479.  
  480. ******* DONATIONS graciously accepted if sent to the following address & will
  481. *******           be applied toward tools used in the continuing development
  482. *******           of TRANS4 and other nifty, educational electronWares.
  483.  
  484. Bitzenboltz ElectronWare
  485. RR#1 Box 90
  486. Burbank, SD 57010
  487.  
  488.  
  489. ***All product names mentioned are the trademarks or registered trademarks of
  490. their manufacturers.
  491.