home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Homebrewer's Handbook / vr.iso / rend386 / doc / demo4.doc < prev    next >
Text File  |  1996-03-19  |  19KB  |  417 lines

  1.  
  2.       REND386 -- A 3-D Polygon Rendering Package for the 386 and 486
  3.                   Written by Dave Stampe and Bernie Roehl
  4.  
  5.                            DEMO4 Documentation
  6.                        Version 4.10 - August 1992
  7.  
  8. This document describes how to use the new REND386 demo, called "demo4.exe".
  9.  
  10. To run the demo, just type "demo4" or "demo4 filename" where 'filename' is the
  11. name of a .plg file, a .fig file, or a .wld file you want to have loaded.
  12.  
  13. The demo4.exe program is designed to illustrate some of the capabilities of
  14. REND386, a polygon rendering library for 386 and 486 systems with VGA
  15. displays.
  16.  
  17. The libraries are available for free; the only reason for making the demo
  18. a separate set of files is to give people who aren't interested in writing
  19. software a chance to see just what can be done on widely-available hardware.
  20.  
  21. The system is fast.  How fast, you ask?  Well, speed is not a straightforward
  22. thing to measure.  There is a relationship between the speed of the processor,
  23. the complexity of the scene, and the number of frames per second.
  24.  
  25. With this software, a 512-polygon scene can be rendered at speeds up to
  26. 15 frames/second on a 486/25; this corresponds to a speed of over 7000
  27. polys/second.  If you have a 486/33, it'll go slightly faster; if you have
  28. a 386/33, it'll go slightly slower.  You get the idea.  If you want more
  29. frames/second, use a simpler scene (i.e. fewer polygons).
  30.  
  31. To use this demo, you MUST have a 386 or 486; it will not run at all on
  32. a 286 or below.  You must also have a standard VGA display.
  33.  
  34. This version now support stereoscopic viewing; the assumption is that you
  35. have the Sega 3D glasses and the interface described in sega.txt installed.
  36.  
  37. The Nintendo Powerglove is also supported: see the July 1990 Byte page 288
  38. for a schematic showing how to wire up an adapter.  Version 4 of the demo
  39. uses the glove to manipulate objects as well.
  40.  
  41. When the demo starts up, it looks for a REND386.cfg file; if one is found,
  42. it is loaded the same way a world file is.  We recommend keeping all your
  43. hardware configuration information in this file; that way you won't have
  44. to specify an extra file on the command line each time.
  45.  
  46. The system now supports a 'loadpath'; this path is used to load any files
  47. that do not have explicit directory specifiers in them.  In other words,
  48. any file (including .wld, .fig, .plg and palette files) whose names do not
  49. contain '\' or '/' will be loaded from the loadpath.  This includes .plg
  50. files specified inside .fig files.
  51.  
  52. The loadpath may be set in a .wld file, or in the REND386.CFG file.  It
  53. can also be set in the REND386 environment variable.  Note that the settings
  54. in the REND386.CFG file will override the setting of the environment variable.
  55. Also note that the REND386.CFG file is always loaded from the current
  56. directory, not from the loadpath specified in the REND386 environment
  57. variable (this is subject to change).
  58.  
  59. The system now supports loadable drivers.  If no other video driver is
  60. specified in REND386.CFG or a world file, then "vd256.rvd" is loaded; this
  61. is the standard 256-color "Mode Y" driver.
  62.  
  63.  
  64. SECTION 0 -- Command-line Parameters
  65.  
  66. The following parameters are supported (all are preceeded with a - or a / and
  67. are not case sensitive:
  68.  
  69.    -x    ensable stereo (use if you don't have sega glasses)
  70.    -m    use mirror stereo
  71.    -r    reverse eyes (left-for-right); useful if your wiring is wrong
  72.    -c d  set the convergence distance
  73.    -s d  set the world scale
  74.    -e d  set the interocular spacing (space between your eyes, in millimeters)
  75.    -j    sort by object (default is to sort by polys)
  76.    -p    depth sort by polys (the default)
  77.    -a    depth sort by object average depth
  78.    -1    use COM1 for Sega glasses
  79.    -2    use COM2 for Sega glasses
  80.    -b    force monochrome ('black and white') mode
  81.    -g    enable the Nintendo Powerglove using the interface from Byte
  82.          magazine (July, 1990 issue)
  83.  
  84.  
  85. SECTION 1 -- Viewpoint control and miscelleneous keys
  86.  
  87. You can use either the joystick or the keyboard to move around.
  88.  
  89. Moving the joystick forward will move you forward, moving it backward
  90. will move you backward.  Moving it to the left turns you to your left,
  91. and moving it to the right turns you to your right.
  92.  
  93. To move sideways without turning, hold down either button and move the
  94. stick left or right.
  95.  
  96. Moving the stick forward and back with one button down will tilt your
  97. head to let you look down or look up.  Moving the stick forward and back
  98. with the other button lets you move vertically.
  99.  
  100. Holding both buttons down lets you control your zoom (by moving the
  101. stick forward and backward) and the tilt of your head (by moving the
  102. stick left and right).
  103.  
  104. There are two 'keyboard movement modes' supported.
  105.  
  106. In the default mode, the keys work as follows:
  107.  
  108.     LEFT ARROW and RIGHT ARROW move you forwards and backwards
  109.     UP ARROW and DOWN ARROW turn you left or right
  110.     PGUP and PGDN let you look up or look down
  111.     CTRL LEFT ARROW and CTRL RIGHT ARROW move you sideways left or right
  112.     CTRL PGUP and CTRL PGDN move you vertically up or down
  113.     CTRL HOME and CTRL END tilt your head counterclockwise and clockwise
  114.     + and - change your zoom factor
  115.     U executes a 'U-turn', turning your viewpoint around 180 degrees
  116.  
  117. In the 'spherical' mode, the keys work as follows:
  118.  
  119.     LEFT ARROW and RIGHT ARROW change your "longitude"
  120.     UP ARROW and DOWN ARROW change your "latitude"
  121.     CTRL LEFT ARROW and CTRL RIGHT ARROW tilt your head left and right
  122.     PGUP moves you towards the center of the sphere, PGDN moves you away
  123.     SHIFT LEFT ARROW and SHIFT RIGHT ARROW move the sphere's center in X
  124.     SHIFT UP ARROW and SHIFT DOWN ARROW move the sphere's center in Y
  125.     SHIFT PGUP and SHIFT PAGE DOWN move the sphere's center in Z
  126.     CTRL PGUP and CTRL PGDN change your zoom factor
  127.     * makes the current view identical to the initial default view.
  128.  
  129. In both keyboard movement modes, the following keys are available:
  130.  
  131.    R repeats your last move 100x (good for doing timings)
  132.    1 through 9 and 0 set your step size, with 0 being 10 (see the Options menu)
  133.    C changes your hither/yon clipping (see below)
  134.    G prompts you for an x,y,z location to jump to
  135.    Q or ESC quits
  136.    ? or H shows help
  137.    D displays your current status
  138.    L loads .plg files,  S saves them; see "plg.doc" for file format
  139.    M loads multi-resolution .plg files
  140.    I gives information about the current object database
  141.    P displays the color palette used by the system
  142.    F loads figure files (see below)
  143.    Z performs object and figure manipulation (see below)
  144.    O sets system options (see below)
  145.    X handles painting (see below)
  146.    ^ saves the screen as a PC Paintbrush (.PCX) file
  147.  
  148. In stereoscopic mode, the following keys apply; they're basically just
  149. holdovers from some    HMD software, but you might get a kick out of them:
  150.  
  151.   [ and ] adjust the vertical offset of the display
  152.   { and } adjust the horizontal offset of the display
  153.  
  154.  
  155. SECTION 2 -- Clipping and Visibility
  156.  
  157. The near clipping plane splits polys that transect it, while the yon
  158. clipping plane just ignores polys that are beyond it; thus the effects are
  159. slightly different.  When part of an object gets clipped by the front
  160. plane, you can see right through the entire object (i.e. you don't see
  161. inside of the far side of the object through the "hole" created by
  162. clipping).  The same is true if you actually move yourself inside an
  163. object; from inside, it's perfectly transparent.
  164.  
  165. You may find occasional visibility errors with certain combinations of objects;
  166. future versions of the software should eliminate these.
  167.  
  168.  
  169. SECTION 3 -- Object and figure manipulation
  170.  
  171. In order to manipulate objects and figures in the scene, you must have a
  172. mouse.  Use the mouse to select an object by clicking on it; it will be
  173. highlighted to indicate that it has been selected.  If you click on it again,
  174. the object will be de-selected.
  175.  
  176. Once you've selected an object, hitting the Z key pops up a menu of
  177. operations you can perform on that object.  These operations are as follows:
  178.  
  179.    M -- moves an object around in 3D, tracking the mouse.  Moving the mouse
  180.         horizontally or vertically moves the selected object in the same
  181.         direction; moving the mouse vertically while holding down the right
  182.         mouse button moves the selected object away from you or towards you.
  183.         Clicking the left mouse button "places" the object, but leaves it
  184.         selected.
  185.         
  186.    R -- rotates the object around in 3D, tracking the mouse (much as for the
  187.         'M' operation described above).
  188.  
  189.    T -- "twirl" is similar to rotate, but instead of controlling the actual
  190.         rotation the mouse now controls the speed of rotation about each of
  191.         the three axes.
  192.  
  193.    I -- gives you information about the selected object, including the
  194.         the total number of vertices and the total number of polygons.
  195.  
  196.    D -- deletes the selected object
  197.  
  198.    S -- saves the selected object to a file
  199.  
  200.    A -- alters an object or figure's surface attributes (see "colors.doc"
  201.         for details)
  202.  
  203.    P -- paints the selected object in the current color and surface type
  204.         (see the color selection menu described below)
  205.  
  206.    H -- "hacks off" (i.e. disconnects) a segment from its parent segment
  207.  
  208.    J -- joins a segment to another segment, which becomes its parent
  209.  
  210.    F -- pops up a "figure" menu, which lets you select the entire figure
  211.         of which the selected object is a part, or obtain information about
  212.         the figure of which the selected object is a part, as well as saving
  213.         or deleting the entire figure.
  214.  
  215.    U -- unselects the selected object
  216.  
  217.    N -- selects the "next" resolution of the object (if the object has more
  218.         than one)
  219.  
  220.  
  221. SECTION 4 -- Painting and Surface Types
  222.  
  223. There are two ways to "paint" objects in the demo: you can paint one
  224. polygon at a time, or paint the entire object.  To select a paint color
  225. and surface type, you use the X key; the surface type and paint color
  226. can be selected independently, but the interpretation of the paint color
  227. will be different depending on the surface type (see colors.doc for details).
  228. From the X menu you can also select P for Paint Polys, which allows you to
  229. paint individual polygons simply by clicking on them with the left mouse
  230. button.  To leave this polygon-painting mode, just click the right mouse
  231. button.  To paint a number of objects the same color, just select the objects
  232. and use Z P to paint them.  They will all be painted with the current surface
  233. type and color.
  234.  
  235.  
  236. SECTION 5 -- Figures and Scenes
  237.  
  238. This version of REND386 contains support for segmented figures.  To load
  239. a segmented figure, use the F key; you'll be prompted for a figfile name.
  240. Try the figure "body.fig", for example.  For details on the construction
  241. of figure files, see "figure.doc".
  242.  
  243. Note that figures are composed of objects, and that movement operations
  244. performed on objects that are part of a figure behave slightly differently
  245. than operations on "plain" objects.
  246.  
  247. Moving an object that is a descendant of another object moves it relative
  248. to its parent, and also affects any descendents it may have.  In the case
  249. of body.fig, the pelvis is the "root" object; moving it moves the entire
  250. figure as a unit.  However, if you select the chest instead of the pelvis,
  251. only the upper half of the body will rotate; if you select only the left
  252. upper arm, only it and the left lower arm will rotate, and so on.
  253.  
  254. You almost never want to move a segment object relative to its parent; the
  255. correct position should be set in the original figure file.  Of course,
  256. rotating a child segment relative to its parent is something you do a lot.
  257.  
  258. This reflects the "real world"; you rotate your body segments at joints, but
  259. you rarely remove your arm from your shoulder and flail it about.
  260.  
  261.  
  262. SECTION 6 -- Options
  263.  
  264. The O key allows you to set several options.
  265.  
  266. The "background" option toggles the use of a fancy background (just a color
  267. cycle, really) on or off.
  268.  
  269. The "reflection" option toggles the use of a "reflecting pool" at the bottom
  270. of the screen on or off.
  271.  
  272. The "logo" option toggles the use of a "REND386" logo on or off.
  273. The logo is stored in PCX file called "logo.pcx".  You can, if you wish,
  274. create a different logo with a paint program and store it in "logo.pcx".
  275. Only the first 30 lines are copied onto the screen, and the file you
  276. create must be in standard 320x200 8-bit (256 color) format.
  277.  
  278. The logo.pcx file provided with the demo is intended to be used with the
  279. fancy background activated (the logo.pcx file contains a copy of the part
  280. of the background that would be covered by the logo).
  281.  
  282. Note that the background, the logo and the reflecting pool are basically
  283. just gimmicks.  They were included in the demo mainly in response to
  284. people who had seen the Ultraforce demo and were asking "why can't rend386
  285. do that".  Well, it can.  We also included the pseudo-metallic surfaces you
  286. see in the Ultraforce demo, since they're a nice (but not exactly novel)
  287. effect.  We also added the pseudo-transparent surfaces you see in the
  288. SuperScape demo, and in fact combined them with the pseudo-metallics to
  289. give a "shiny" window effect.
  290.  
  291. The "screen clear" option allows you to control screen pre-clearing.  If
  292. the scene you're looking at has no "sky" or "ground" showing, this is a
  293. good option to use (since it will increase rendering speed).  However, if
  294. you have any parts of the screen not obscured by a polygon, you'll get
  295. strange and ugly effects.
  296.  
  297. The "ambient light" option allows you to control the overall brightness of
  298. the scene.  The default value is 76.
  299.  
  300. The "directional light" option allows you to toggle the single light source
  301. between "spot" or "point source".  The difference is that the spot is
  302. at an infinite distance.
  303.  
  304. The "horizon" option allows you to toggle between simple screen clears and a
  305. more sophisticated sky/ground horizon clear.
  306.  
  307. The "motion step size" lets you set the increment to use for space movements
  308. or angular movements.  This gives you separate control over each, whereas the
  309. use of the 0-9 keys controls both together.
  310.  
  311. The "keyboard mode" option lets you switch between the "default" mode
  312. and the "spherical" mode (both described above).
  313.  
  314. The "position display" option toggles the display of your current (x,z)
  315. coordinates on or off.
  316.  
  317. The "compass display" option toggles the 3-D compass on or off.
  318.  
  319. The "frame rate display" option toggles the frame rate display on or off.
  320.  
  321.  
  322. SECTION 7 -- Powerglove suppoprt
  323.  
  324. If you have a Nintendo PowerGlove hooked up to your parallel port using the
  325. cable described in Byte Magazine (July 1990 issue, page 288) then you can
  326. specify the -g option on the command line to enable glove support.
  327.  
  328. If you find the glove fingers are twitching (and your real fingers aren't),
  329. then make a fist a few times.
  330.  
  331. Note the gesture display on the screen.  There's a half-second deglitch time,
  332. so hold a gesture a bit before you move.
  333.  
  334. Four gestures are used: flat (neutral), point (select), fist (grab),
  335. and pinch (twist).  Pinch is the hardest to do: bend your index finger
  336. (thumb optional) while keeping you other fingers straight.  Other
  337. gestures are detected but not yet used.
  338.  
  339.      Flat does nothing.
  340.  
  341.      Point selects an object your virtual hand is close to.  You may find
  342.      objects "competing" with each other for selection; just move around
  343.      until the one you want is the one selected.
  344.      
  345.      Fist grabs the selected object and moves it (even at a distance!).
  346.  
  347.      Pinch grabs a line between your fingers and the object center (or joint
  348.      for a jointed object) and rotates the object by it.  This code is not
  349.      quite right yet; we may replace it with trackball rotation in a future
  350.      release.
  351.  
  352.  
  353. SECTION 8 -- Final notes
  354.  
  355. Feel free to create your own objects; read the various .doc files 
  356. for a description of the format the demo uses.  Note that .plg
  357. format is not in any way tied into the REND386 library; it's just a
  358. convenient format used for the demo.  In fact, plg is not our recommended
  359. polygon format.
  360.  
  361. We're encouraging people to standardize on OFF as a graphics file format;
  362. the OFF documentation can be found on sunee.uwaterloo.ca in the pub/vr
  363. directory.
  364.  
  365. OFF is a reasonably good, open format that encodes author/copyright
  366. information along with geometry and colors.  While it's a bit of a
  367. nuisance to parse, it's very easy to generate.  It's also extensible,
  368. which is important for long-term success.  We're putting the finishing
  369. touches on an OFF2PLG converter that will let you use all kinds of OFF
  370. objects with this demo.
  371.  
  372. Some of our data files were converted from OFF files using off2plg: the
  373. bishop and the banana.  Below is the author/copyright information from
  374. their .aoff files:
  375.  
  376. name        bishop8
  377. description    chess piece - bishop
  378. author        Randy Brown, brown@cs.unc.edu
  379. copyright    (c) Randy Brown, OK to distribute if copyright/author appears 
  380.  
  381. name        banana
  382. description    Banana made on Frank Crow's U. Utah surface design system
  383. copyright    (c) Ohio State Univ. - ok to distribute if copyright appears
  384.  
  385. Several of the objects in the room demo were created by Gershon Elber's
  386. IRIT program, and converted to .plg format using a converter contributed
  387. by Gershon Elber himself.
  388.  
  389. The major contribution others can make to the project at this stage is
  390. to write converters from other polygon formats to OFF.  In particular,
  391. a DXF to OFF converter would let us create objects with most CAD packages.
  392.  
  393. If you enjoy using the package, and are interested in developing your own
  394. applications, you can obtain the latest version of the libraries and
  395. documentation via anonymous ftp from sunee.uwaterloo.ca in the pub/rend386
  396. directory.
  397.  
  398. If you have any questions, or would like to help work on future projects
  399. related to this package or other VR-related hardware and software, feel
  400. free to contact us:
  401.  
  402.         Bernie Roehl (broehl@sunee.uwaterloo.ca)
  403.         Dave Stampe (dstampe@sunee.uwaterloo.ca)
  404.  
  405. (For those who are curious, sunee.uwaterloo.ca is in the Electrical and
  406. Computer Engineering Department of the University of Waterloo in Ontario,
  407. Canada).
  408.  
  409. There is also a mailing list, rend386@sunee.uwaterloo.ca (to be added
  410. to the list, send mail to rend386-request@sunee.uwaterloo.ca).  Traffic
  411. should be reasonbly low; if it gets too high, we're willing to go to a digest
  412. format.
  413.  
  414. Have fun!
  415.  
  416.                                    -- Bernie Roehl, August 1992
  417.