home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Zone / VRZONE.ISO / mac / TEXT / MISC / VORL.TXT < prev    next >
Text File  |  1992-07-05  |  14KB  |  326 lines

  1. Article 4437 of sci.virtual-worlds:
  2. Path: watserv1!torn!utcsri!rpi!usc!cs.utexas.edu!uunet!ogicse!news.u.washington.edu!milton.u.washington.edu!hlab
  3. From: 74040.1543@CompuServe.COM (Omar Loggiodice)
  4. Newsgroups: sci.virtual-worlds
  5. Subject: TECH: VORL a world description language
  6. Message-ID: <1992Jul6.085449.8585@u.washington.edu>
  7. Date: 4 Jul 92 17:07:25 GMT
  8. Article-I.D.: u.1992Jul6.085449.8585
  9. Sender: news@u.washington.edu (USENET News System)
  10. Organization: University of Washington
  11. Lines: 309
  12. Approved: cyberoid@milton.u.washington.edu
  13. Originator: hlab@milton.u.washington.edu
  14.  
  15.  
  16.    This is a file which I wrote months ago to generate discussion about the
  17.    world description language. Due to the message post by Bernie about the
  18.    topic, I decide to post it in sci.vw. I've have found some errors in it,
  19.    especially in the example, in a future revision I'll correct them and add
  20.    other ideas.
  21.  
  22. File: WEOL02.TXT
  23. From: Omar Loggiodice [74040,1543]
  24. Subj: World Editor File structure
  25.                  ...                         ...
  26.                  ...      ......             ...
  27.                  ...      ...   ...          ...
  28.                  ...      ...     ...        ...
  29.                  ...      ...      ...       ...
  30.                  ...      ...      ...       ...
  31.                  ...      ...     ...        ...
  32.                  ...      ...  ...           ...
  33.                  ...      ...    ...         ...
  34.                  ...      ...     ...       ...
  35.                   ...     ...      ...     ...
  36.                    ...                    ...
  37.                      ...    ..   .   ..  ...
  38.                        ...    .W.E.W.   ...
  39.                         ...    . P .   ...
  40.                           ...        ...
  41.                             ...     ...
  42.                               ...  ...
  43.                                 ...
  44.  
  45.  
  46. ------------
  47. Introduction
  48. ------------
  49.  
  50.    With the following document I try to describe some ideas I have had
  51. regarding
  52. the Virtual World Structure (VWS), it's representation and implementation, for
  53. the World Editor project being currently developed by an on-line community
  54. from
  55. the Computer Arts forum (COMART) in it's Virtual Reality section. It must be
  56. noticed that the following is a VERY ROUGH draft which still needs lots of
  57. refinement. I have left many topics out, but with small steps we will
  58. finally climb the ladder.
  59.  
  60.    To define the VWS I tried to borrow as much as I can from the real world,
  61. since our objective is to model it, this will lead to a more accurate
  62. representation; however, we must be aware that the implementation will be
  63. made in a computer environment so the structure must be suitable for it.
  64.  
  65.    This is a first draft, thus, comments and discussion will finally lead to
  66. the final representation and structure, this is why I encourage you to email
  67. me giving feedback. I have volunteered to work in the VWS and it's
  68. representation for the WE/WP project, this is my first contribution regarding
  69. these issues, alhtough it borrows some definitions made in the files
  70. explaining the virtual computer concept I was working in (WEOL00.TXT and
  71. WEOL01.TXT).
  72.  
  73.    Omar Loggiodice [74040,1543]
  74.    Assistant Leader of WE/WP project.
  75.  
  76. --------------------------------------------------
  77. The Virtual World Structure and its representation
  78. --------------------------------------------------
  79.  
  80.    Let's look around us for a while, what do we see?. Well, we see there
  81. are lots of "objects" acting upon each others. We are one of those objects,
  82. and
  83. we act upon others by touching them, for example. We "see" objects because
  84. light acts upon the object, this in turn reflects it, and finally light
  85. "touches" our retina. We are able to hear music because the speaker "acts"
  86. upon air which finally reaches our ears.
  87.  
  88.  As we can see in the above examples, the "interface" that gives us
  89. information from the world are our senses, thus, to create a virtual world, we
  90. must act on our senses; and thus the definition I use of an object which
  91. belongs to the virtual world: A set of effects on our senses (the "effects"
  92. might be changing with time or not). This is a very general definition, and we
  93. are not, technologically speaking, able to fullfil all it's requirements, so
  94. we are focusing on some senses first such as sight.
  95.  
  96.    I propose the Virtual world to be composed of objects which act upon each
  97. others. The following diagram tries to explain this.
  98.  
  99. **************              **************                 ************
  100. *  Object 1  *<-----------> *  Object 2  *<-------....---> * Object n *
  101. **************              **************                 ************
  102.       / \                    !                               / \
  103.        !                     !--- This could be VH.           !
  104.        !----------------------------------------...-----------!
  105.  
  106.    So, all objects interact with each other. One of those objects is very
  107. special, it represents the "human" that is "living" in that virtual world,
  108. or, as I called him before 'virtual human'. It is a very special object
  109. because it is the only object that should be able to comunicate with the
  110. real world, with the human that he represents. This 'virtual human' (VH)
  111. is able to receive information from his real 'clone' (uhhh!) in some way,
  112. for example by means of the PowerGlove or the head position detector.
  113.  
  114.    All the objects hold information about what they are, such as their
  115. visual characteristics, their sounds, etc... and how they act upon other
  116. objects: stoping them if they get to near, not making them visible, etc.
  117.  
  118.    We also need to consider the scope of an object, that is, an object
  119. can't be seen everytime, everywhere in the VW, so we need to define the
  120. the scope of the object.
  121.  
  122.    From the explanation we can conclude that to define an object we need:
  123.       - possible actions upon other objects
  124.       - representation in term of the senses (for now only
  125.         visual or graphical representation)
  126.       - Reactions to other objects
  127.       - scope of the object
  128.  
  129.    It is important to define the actions that an object can make upon
  130. other objects, for now, I consider the following:
  131.       - Change of position
  132.       - Change of graphical representation
  133.       - Change of the scope (which is defined by the scene)
  134.  
  135.    This has been a general explanation of the concept but to implement it we
  136. have been thinking about a "script" language. In the next section I will try
  137. to make a definition of such a language (VORL).
  138.  
  139. ----------------------------------
  140. VORL definition  (script language)
  141. ----------------------------------
  142.  
  143.    I propose the script to be divided in two sections: The World definition
  144. section, and the object description section. The world will be divided in
  145. scenes, each one is composed of a set of objects. The description of each
  146. scene is contained in the scene section in the source code of the script.
  147.  
  148.    Each section, contains a set of objects which are described in the
  149. object description section. The following is the language structure, words
  150. in brackets are user-generated, while the others are keywords of the language.
  151. /* World definition */
  152. Scene#<n>
  153. :trigger
  154. {
  155.    <object_id>, <object_msg_id> <boolean op> <object_id>, <object_msg_id>..;
  156.    .
  157.    .
  158. }
  159. :description
  160. {
  161.    <object_id>;
  162.    .
  163.    .
  164. }
  165.  
  166. /*object description*/
  167. <object_id>:
  168. {
  169.    <object_msg_parameter> <relational op> <object_msg_parameter>
  170.    <boolean op>
  171.    <object_msg_parameter> <relational op> <object_msg_parameter>:-
  172.                                    {<statement>;
  173.    .                                <statement>;
  174.                                     .
  175.                                    }
  176.    .
  177.    .
  178. }
  179.  
  180. <n>: Integer that identifies each scene
  181. <object_id>: string that identifies and object
  182. <object_msg_id>: string that identifies a specific message
  183. <boolean op>: OR|AND|NOT
  184. <object_msg>: is a structure that contains the following
  185.                - <object_id> this is the sender of the message
  186.                - <object_msg_id>
  187.                - long LONGPARAMETER x
  188.                - long LONGPARAMETER y
  189.                - long LONGPARAMETER extra
  190. <object_msg_parameter>:Object_Id|MSG_ID|x|y|extra
  191. <relational op>: >|<|<=|>=|=|!=
  192. <GraphicDescriptor>: a structure containing the graphic representation of the
  193.                      object, I would suggest it to conform to a predefined
  194.                      graphic file format.
  195. <position>: a structure containing the coordinates to draw an object
  196. <statement>: Any of the following: (for now)
  197.             - SendMessage(<object_id>|scene#<n>,<object_msg>)
  198.             - draw(<GraphicDescriptor>,<position>)
  199.             - load(<filename>,<GraphicDescriptor>)
  200.             - Functions for adding & deleting objects to a scene
  201.             - Functions for modifying the <GraphicDescriptor>
  202.             - Assignments
  203.             - if-else
  204.  
  205.  
  206.    Let me give an example to show how the language works. Suppose we have two
  207. scenes: the first one is just a door, the second is a table. The script
  208. code which will define the virtual world could be:
  209.  
  210. /* world description */
  211. Scene#<0>
  212. :trigger
  213. {
  214.    scene1_door, door_open;
  215. }
  216. :description
  217. {
  218.    door;
  219. }
  220. Scene#<1>
  221. :trigger
  222. {
  223.    door, door_open;
  224. }
  225. :description
  226. {
  227.    table;
  228.    scene1_door;
  229. }
  230.  
  231. /*object description*/
  232. door:
  233. {
  234.    MSG_ID=OM_PAINT:-  {load("door.grf",door_GD);
  235.                        IniPos.x=10;
  236.                        IniPos.y=10;
  237.                        IniPos.z=10;
  238.                        draw(door_GD,IniPos);
  239.                       }
  240.    MSG_ID=OM_CLICK AND Object_Id=VH:-  {load("open_door.grf",door_GD);
  241.                                         IniPos.x=10;
  242.                                         IniPos.y=10;
  243.                                         IniPos.z=10;
  244.                                         draw(door_GD,IniPos);
  245.                                         Open=1;
  246.                                        }
  247.    MSG_ID=OM_POS AND Object_Id=VH:- { if x=10 and y=10 and z=10 and
  248.                                       Open=1
  249.                                       {
  250.                                           SendMessage(scene#1,door_open);
  251.                                           Open=0;
  252.                                       }
  253.                                     }
  254.    MSG_ID=OM_ERASE:-  undraw(door_GD);
  255.  
  256. }
  257. scene1_door:
  258. {
  259.    MSG_ID=OM_PAINT:-  {load("2ndoor.grf",door_GD);
  260.                        IniPos.x=10;
  261.                        IniPos.y=10;
  262.                        IniPos.z=10;
  263.                        draw(door_GD,IniPos);
  264.                       }
  265.    MSG_ID=OM_CLICK AND Object_Id=VH:-  {load("open_door.grf",door_GD);
  266.                                         IniPos.x=10;
  267.                                         IniPos.y=10;
  268.                                         IniPos.z=10;
  269.                                         draw(door_GD,IniPos);
  270.                                         Open=1;
  271.                                        }
  272.    MSG_ID=OM_POS AND Object_Id=VH:- { if x=10 and y=10 and z=10 and
  273.                                           Open=1
  274.                                         {
  275.                                           SendMessage(scene#0,door_open);
  276.                                           Open=0;
  277.                                         }
  278.                                     }
  279.    MSG_ID=OM_ERASE:-  undraw(door_GD);
  280.  
  281. }
  282. table:
  283. {
  284. MSG_ID=OM_PAINT:-  {load("table.grf",table_GD);
  285.                        IniPos.x=0;
  286.                        IniPos.y=0;
  287.                        IniPos.z=0;
  288.                        draw(table_GD,IniPos);
  289.                       }
  290. MSG_ID=OM_ERASE:-  undraw(table_GD);
  291. }
  292.  
  293.    As you can notice, there are a set of predefined variables and messages.
  294. The
  295. variable SCENENO is global, and it contains the scene number. The message
  296. OM_CLICK is generated whenever the mouse or any similar action (such as the
  297. closing of the hand with the PowerGlove) occurs. The message OM_PAINT is
  298. generated whenever a change of scene is made, and it is sent to all the
  299. objects on that scene. The message OM_ERASE is generated when there is about
  300. to be a scene change. The message OM_POS is generated when an object wants to
  301. inform about it's position to another object. Notice that all the scenes
  302. contain a special object called VH which stands for the Virtual Human (see
  303. file
  304. WEOL01.TXT).
  305.  
  306.    The interpreter does the following:
  307. The "root" scene, or scene 0 is always the first scene. So the interpreter
  308. sets the global variable SCENENO to 0 and sends a OM_PAINT message to all
  309. the objects that compose scene. The objects paint themselves and the control
  310. return to the message dispatcher in the interpreter. When the user (now VH)
  311. clicks the mouse (or uses the glove in a similar way) over the door a OM_CLICK
  312. is generated by the message dispatcher and it is sent to the pertinent object
  313. (the door in scene 0), the door processes the message and it is opened. If the
  314. VH changes his position (moving the glove or mouse) an OM_POS is generated and
  315. sent to all the objects in the scene. The door checks the position of the VH
  316. and if it is the correct one it forces a jump to scene 2. The  rest of
  317. the code works in a similar way.
  318.  
  319. Omar Loggiodice CompuServe: 74040,1543
  320.                 Internet:   74040.1543@compuserve.com
  321.  
  322. Assistant Leader of WE/WP project.
  323. ---->ORL
  324.  
  325.  
  326.