Creating Virtual Worlds on the Web

by Maria Russell

What is VRML?

VRML (Virtual Reality Modeling Language) was created in an attempt to bring 3D content to the Web. VRML 1 was quickly released but was limited in the sense that the worlds were still. Developing VRML 2 brought life to the 3D worlds. When writing VRML 2 code, a VRML 2 browser such as CosmoPlayer is needed to display the virtual worlds.


An example of primitive VRML shapes

CosmoPlayer works with Netscape Navigator 2 or 3.0 or Internet Explorer 3.0. An editor, such as emacs or vi is also needed to write the worlds. For worlds too complex to be edited by hand, a 3D authoring tool can be used to create complex animations and other features designed specifically to help the casual user create VRML worlds.

A simple VRML 2 program

First, every VRML 2 file must start with the header line:

This tells the browser that this is a VRML version 2 file and that it uses the UTF8 (International Standards Organization standard that allows characters in the file to be read by a text editor) encoding. The following is a very simple example of a VRML 2 world displaying a red cone:

   #VRML V2.0 utf8
   Transform {
      translation 4 5 0
      children Shape {
         appearance Appearance {
            material Material {
               diffuseColor 1 0 0
            }
         }
         geometry Cone {}
      }
   }

The proceeding example would need to be saved to a file with the extension wrl (i.e., filename.wrl). Then simply start Netscape or Internet Explorer 3.0, on atom if working on the computers at UNLV, and open the file. CosmoPlayer will automatically pop up displaying a red cone.

Certain basic geometric shapes such as the cone, sphere, box and cylinder are automatically recognized, but VRML also allows the creator flexibility to make more complex objects. This is done by either rendering solid faces given points or by simply drawing lines connecting the points.

In Conclusion

VRML 2 is a powerful way to add the virtual experience to a web page. Through the use of interactively and event response, VRML worlds come to life. The ability to add such details as fog, sound, backgrounds and lighting brings a more realistic look to an otherwise virtual world.

[an error occurred while processing this directive]