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

  1. WHAT IS VR-386?
  2.  
  3. VR-386 is a freeware VR program for the IBM PC (386 and higher)
  4. compatibles.  It supports many VR devices, including stereo
  5. flicker glasses, HMDs, the Nintendo PowerGlove, joysticks, and
  6. so on.  VR-386 has the fastest drawing speed of any VR software
  7. in its class, exceeding 20,000 polygons per second.
  8.  
  9. VR-386 is being developed by Dave Stampe, and is an ongoing project
  10. which hopefully will bring in other programmers to contribute small
  11. sections of the functionality (see the programmer's notes later).
  12. VR-386 is descended from REND386, which was developed by Dave Stampe
  13. and Bernie Roehl, which is documented in the book "Virtual Reality
  14. Creations", published by Waite Group Press.  VR-386 supports most of
  15. the features in the VRC release (version 5), and adds new features.
  16.  
  17. NEW FEATURES
  18.  
  19. Some of the new features of VR-386 include its better timebase for
  20. timing and control, its better internal organization for future
  21. upgrades, and its simplified programmer interface.  Perhaps most
  22. important VR-386 supports EMM386 for up to 4 megabytes of memory for
  23. object storage.  This compensates for the large memory use of VR-386
  24. caused by its extensive use of caching to increase rendering speeds.
  25.  
  26. Many future enhancements are planned, as listed below.  Most important,
  27. VR-386 represents a new beginning and new commitment to programmers
  28. after the problems of REND386.
  29.  
  30.  
  31. INTERNAL REWRITES
  32.  
  33. Where VR-386 differs from REND386 is in its internals.  While REND386
  34. explored new ideas in VR and developed techiques for high-speed
  35. software implementation of graphics and interfaces for VR, it was very
  36. difficult to program with.  Full source code availablilty wasn't enough.
  37. VR-386 begins the process of reorganizing and cleaning up the code to
  38. make it accessible to programmers.
  39.  
  40. About 90% of the old code has been rewritten by Dave Stampe, who
  41. developed most of the original algortihms for REND386.  This rewrite is
  42. aimed at cleaning up many of the programming style problems with the
  43. original code.  By removing much of the inline assembler, the
  44. dependance on Borland C will be lessened.  By using special API data
  45. types (discussed later) it should be easier to use libraries in many
  46. C compilers and to eventually port the code to 32-bit comilers such as
  47. Watcom C32.
  48.  
  49. Internally, the super-fast integer/fixed-point math routines have been
  50. expanded and split off into a seperate library.  This unit is completely
  51. stand-alone, so may be used in other projects.  The renderer code has
  52. bee completely rewritten, with all in-line assembler split off into
  53. seperate .ASM files and the code reorganized for clarity.  The renderer
  54. requires only simple support (drawing) routines from the video drivers
  55. and integer math library to function.  It should be much easier to add
  56. extensions to the renderer now.
  57.  
  58. The PC interface and devices have been rewritten to be more robust
  59. in operation and to use new methods for joystick and timer control.
  60. New devices such as a key-status monitor improve the responsiveness
  61. of the user interface.
  62.  
  63.  
  64. THE API
  65.  
  66. One of the difficulties for programmers with REND386 was its many
  67. data structures and the complex relationships between them.  While
  68. this maximized efficiency of execution, it made learning to program
  69. tough.  Also, upgrading was made complex because many function calls
  70. depended on data structure capabilities.  Finally, the extensive
  71. interdependencies of modules made modification or creation of new
  72. programs very difficult.
  73.  
  74. To solve this, and to make adding future extensions possible, an
  75. API (application programming interface) was used as the basis for
  76. the VR-386 function prototypes.  The API hides much of the
  77. implementation of VR-386 from programmers (it is still available,
  78. of course, by direct programming).  At this moment, the API is
  79. not yet fixed: the final form of the API is open for input.
  80.  
  81. The API uses a few simple types to implement common operations.  These
  82. are the most important new types:
  83.  
  84. OBJECT:  combines visible objects (fixed and moveable) and invisible
  85. moveable "objects" (old segments) into linked object structures.
  86. OBJECTs can have types, be related and so on.
  87.  
  88. POSE:  rather than trying to handle position and motion by six
  89. variables per object, the POSE structure handles all motions and
  90. positions in the world.  This structure will be crucial for thee
  91. animation part of the API (under development).
  92.  
  93. CAMERAS:  these encapsulate the entire idea of drawing, stereoscopy,
  94. and viewpoints.  CAMERAs have many characteristics, can be attached to
  95. objects, moved to a POSE, and so on.  They are much like objects.
  96. Screen updating has been split off into several user-modifiable
  97. modules to preclear and add overlays to the screen after rendering.
  98. Stereoscopic cameras are supported transparently, and stereo
  99. rendering is even more flexible.
  100.  
  101. LIGHTS:  are an object-like item as well.  They should be very extendable,
  102. and are supported by user-modifieable parts of the VR-386 code.  For
  103. now, a single list of lights per world is supported, but future versions may
  104. expand this.  Three types of lights are supported: ambient, point
  105. (which may be positioned), and directional spot lights (which are
  106. rotated).  These lights may be moved or attached to objects as well.
  107.  
  108. TELEPORTS:  User movement is very important for flexible use of
  109. virtual worlds.  The user's body is now built in to VR-386 as
  110. the default, with the body consisting of a rotatable head for
  111. head-tracker support for HMDs, and moveable hand for glove or
  112. manipulator support.  The body may be attached to and moved by objects
  113. in the world as well.  By default, the body is invisible, but objects
  114. may be attached to it if desired.
  115.   The TELEPORT is a way of formalizing jumps in user position.  This is used
  116. to implement the old "cameras" in REND386.  CAMERAS are now disembodied
  117. viewpoints, which may be attached to visible objects if desired.  The
  118. TELEPORTs act to record and restore user positions in the world, and
  119. also restore body connections to omoving objects the body may have been
  120. "riding".  In the future, teleports will also be able to switch between
  121. WORLDS.
  122.  
  123. WORLDS:  Development of WORLDs is just beginning in this preliminary release.
  124. A world consists of visible objects, invisible objects, SPLITS
  125. for subdivision and visibility control, and inactive (hidden) objects.
  126. The idea of inactive objects is to remove objects from all world drawing and
  127. support, yet keep them available for quick adding and deleting.  In the
  128. future, multiple WORLDs will be loadeable, and entire WORLDS may be deleted
  129. from memory with with one call.  The development of SPLITs from a
  130. minor visibility control role to an important role in world design
  131. and motion control will be important in future releases as well.
  132.  
  133.  
  134. USER INTERFACE:
  135.  
  136. The user interface has been rewritten to make updates easier.  The menu
  137. interface has been streamlined with a more modular key processing structure,
  138. better methods for cursor and screen restoration, and so on.  The ability to
  139. select objects with the mouse has been greatly simplified, and object
  140. vertices may be selected as well.
  141.  
  142. Movement of the user via keys, joystick, and other devices has been
  143. integrated.  All motion is now done with POINTER devices and a
  144. navigation processor.  These POINTER devices are common to 2D and 3D
  145. manipulation, and are simple to write.  Future releases will integrate
  146. 3D navigation devices as well.
  147.  
  148. In general, look at MAIN.C and KEYBOARD.C to see how to change the
  149. user interface.
  150.  
  151.  
  152. MODIFICATION OF SOFTWARE:
  153.  
  154. The most important goal of VR-386 was to make it easy to create new programs
  155. that share most of the features of VR-386 while making it easy to
  156. drop or change unwanted features.  You can see an example of this in
  157. the MINIDEMO project, which has only a few changed modules.  These
  158. changes mostly drop support for the PowerGlove, simplify the menu
  159. interface, and automatically load and switch figures in and out of the
  160. world.  Only a few modules are changed, and this entire project was
  161. done in less than 2 hours.
  162.  
  163. To start using the VR-386 code in your programs, read the VR_API.H
  164. file.  This documents all of the API functions in more or less detail.
  165. Print out and read this file-- you'll be glad you did!
  166.  
  167. If you want to use the renderer core, print out RENDERER.H, and INTMATH.H
  168. for documentation of the integer/fixed/matrix/trig library.
  169.  
  170.  
  171. DEVELOPMENT:
  172.  
  173. This release of VR-386 is meant for evaluation only.  The idea is to
  174. gather comments on the API interface, to list future expansions and
  175. so on.  If you write code with it, remeber that some parts of the API may
  176. change soon.  After this, API changes will only be addition of new
  177. functions.
  178.  
  179. There are severasl steps to be done before final release.  These include
  180. more commenting, use of the API types throughout the code, and adding
  181. some functionality.  Changing of syntax of DOS C functions to Microsoft
  182. standard (i.e. disable() becomes _disable() ) will increase portability
  183. between compilers.
  184.  
  185. The development of VR-386 will be more strict than REND386 was, to make
  186. it possible to integrate new capabilities into VR-386.  If you ever want
  187. your code to remain compatible with (and possibly to be integrated with
  188. main releases of) VR-386, follow these rules:
  189.  
  190. - NEVER modify any modules that are hidden by or part of the VR-386
  191. API.  You can change MAIN, KEYBOARD, and USCREEN, USERVID and COLORMAP
  192. if needed, but remember to rename these first.  ANY other modules
  193. that are changes should be renamed, and any functions in them
  194. that are modified renamed as well.  Best of all, have ONLY changed
  195. routines in new modules.  The idea is to be able to trace changes and
  196. their dependancies.
  197.  
  198. - If you want to add basic features to VR-386, talk to Dave Stampe
  199. (dstampe@psych.toronto.edu) first.  Someone else may be working on
  200. such a feature.  It is also important to use an interface that matches
  201. the API, which should be designed and approved in advance.  It's
  202. amazing how interface specification affects how code is written.
  203.  
  204. - Be efficient!  There has been a lot of effort spent in VR-386 to
  205. use the fastest possible algorithms.  If your code slows down
  206. VR-386, it will not be included or will be rewritten or replaced.
  207. Sorry, but there have to be standards.  If in doubt, discuss your
  208. kernal code with me first.
  209. Also, please be concise with your code.  There is no reason to
  210. create huge modules that duplicate existing functionality.  Use
  211. the integer/matrix math library where possible.
  212.  
  213. - Debugging:  be sure your code is tested and causes NO crashes,
  214. and has no known bugs.  I don't really have time to debug code:
  215. in fact the hardest part of and development effort is in puzzling
  216. out other's code.
  217.  
  218.  
  219. COPYRIGHT AND LICENSE:
  220.  
  221.  This code is part of the VR-386 project, created by Dave Stampe.
  222.  VR-386 is a desendent of REND386, created by Dave Stampe and
  223.  Bernie Roehl.  Almost all the code has been rewritten by Dave
  224.  Stampe for VR-386.
  225.  
  226.  Copyright (c) 1994 by Dave Stampe:
  227.  
  228.  CONTACT: dstampe@psych.toronto.edu
  229.  
  230.  Dave Stampe (dstampe@psych.toronto.edu, dstampe@sunee.uwaterloo.ca)
  231.  is completing his doctorate at University of Toronto, and does a
  232.  lot of contract programming and development.  Most of this is in
  233.  other fields than VR, but there is a lot of knowledge transfer
  234.  to and from REND386.  Dave is maintaining the VR-386 project for
  235.  programmers.  Send any code or comments to him.
  236.  
  237.  
  238. LICENSE:
  239.  
  240.  May be freely used to write software for release into the public domain
  241.  or for educational use; all commercial endeavours MUST contact Dave Stampe
  242.  (dstampe@psych.toronto.edu) for permission to incorporate any part of
  243.  this software or source code into their products!  Usually there is no
  244.  charge for under 50-100 items for low-cost or shareware products, and terms
  245.  are reasonable.  Any royalties are used for development, so equipment is
  246.  often acceptable payment.
  247.  
  248.  ATTRIBUTION:  If you use any part of this source code or the libraries
  249.  in your projects, you must give attribution to VR-386 and Dave Stampe,
  250.  and any other authors in your documentation, source code, and at startup
  251.  of your program.  Let's keep the freeware ball rolling!
  252.  
  253.  DEVELOPMENT: VR-386 is a effort to develop the process started by
  254.  REND386, improving programmer access by rewriting the code and supplying
  255.  a standard API.  If you write improvements, add new functions rather
  256.  than rewriting current functions.  This will make it possible to
  257.  include you improved code in the next API release.  YOU can help advance
  258.  VR-386.  Comments on the API are welcome.
  259.  
  260.  
  261. AVAILABILITY:
  262.  
  263. Currently, VR-386 is available on a trial basis by anonymous
  264. FTP from psych.toronto.edu, in the ~ftp/pub/vr-386 directory.
  265. The development package is vr386.zip.  Many new video drivers are
  266. available in video.zip including source code.  A driver for the
  267. Cyberscope is available as cyber.zip.
  268.  
  269. This University of Toronto site has a much wider bandwidth than the Waterloo site:
  270. please let me know IMMEDIATELY of any problems!
  271.  
  272. - Dave Stampe
  273. (dstampe@psych.toronto.edu)
  274.