Programming

We would not be able to accomplish our goals for Global Warming World by just building objects and describing how they look and sound. This would give us a static world full of inert objects, and nothing to do but look around. Object behaviors determine how the participant can interact with the world, and how the objects in the world react to the participant.

Programming behaviors in a virtual environment often takes the form of specifying sets of causes and effects. The causes we refer to as events which then serve to trigger effects called actions. Common events are such occurrences as: two objects colliding, a button being pressed, or an object being picked up. Actions generally involve a change in the attributes of an object such as a change in color, size, position, or even geometry.

Another aspect of world building that we think of as a programming task is the specification of the more abstract properties of objects. This includes physical properties such as mass and elasticity, simulation properties such as collision detection and motion constraints, and abstract computational properties such as variables and data. These properties can be used in combination with existing events and actions, as well as additional ones written in a programming language such as 'C' or 'C++' to create complex and interesting interactions.

We used the dVS/dVISE software from Division, Inc. for programming and experiencing Global Warming World. The dVISE virtual environment development system provides an extensive set of events and actions to work with.

Events

Events are the causes in a virtual environment. They are the source of interaction: anything that the participant does must create an event if the computer is to respond to it. On a Macintosh or Windows desktop, clicking, dragging, selecting, and double-clicking are events that tell the computer what to do. These events have parallels in VR systems. The table below gives a few examples:

Macintosh Desktop

Global Warming World

Clicking on the "close gadget" closes a window. Pressing the rain gauge button makes the rain gauge appear.
Dragging an icon into a folder causes a file to be copied. Touching the water with the thermometer measures water temperature.
Pressing the 'Q' key on the keyboard types the letter 'Q'. Pressing the "Fly Forward" button on the wand propels the participant in the direction that are looking.
Moving the slider upward on the sound control panel changes the volume of the ìEepî sound. Turning the Wheel of Forestry clockwise increases the number of trees in the world.

Actions

Events trigger actions. Typical actions make changes in the properties of objects in the virtual environment.

Typical Actions
Change the color of an object.
Change the size in the X direction by 50%
Instantly change an objectís position.
Move an object from point A to point B over the course of 10 seconds.
Rotate an object 15 degrees about the Z axis.

The mercury in the thermometer is geometrically a hexagonal column. When the thermometer touches the surface of the water object a collision event occurs which then triggers a series of actions including checking the current value of the water temperature, and stretching the mercury in the thermometer to a size proportional to the temperature.

Additional Properties

In addition to specifying events and subsequent actions, there are also numerous attributes of the virtual environment that need to be specified in the VR simulation software.

Some VR software is capable of simulating aspects of physics like gravity and elasticity. In order to make two balls bounce off of each other, we need to program them with their weight and elasticity characteristics. We also need to specify how the collisions between objects are registered (if at all). With pool balls, it is a simple calculation to determine when two collide. If you have non-spherical objects, it often it saves computer processing power to represent objects as boxes for collision purposes. We represented the thermometer as a box for collisions, as it is not important to be extremely precise about dunking it in the water.


The Wheels of Forestry, Industry, and Transportation have a special attribute in that they can be rotated on only one axis. This attribute is called motion constraint, and can potentially be applied to different combinations of the movement and rotational dimensions. An elevator might be constrained to only slide up and down on the Y axis.

Global Warming World contains a set of variables associated with different aspects of the environment. These variables store such information as the air temperature, the water temperature, the anual rainfall, etc. There is a complete list of these variables in the design document. The values of these variables can be changed by different events in Global Warming World.

Complex Behaviors

One of the most complicated behaviors (actually a set of behaviors) in Global Warming World is the environmental simulation. This is a custom behavior was written in the 'C'; programming language and is an extension to the set of behaviors provided by the dVISE VR development system.


Next Topic | Home