LIS 525 - VRML and X3D

VRML

VRML (Virtual Reality Modeling Language) (pronouced "VER-mull") is a specification for displaying 3-dimensional objects on the Web. To view VRML files (which have the extension *.wrl), you need a VRML browser or a VRML plug-in. The browser or plugin provides such capabilities as zooming and rotation; "hot" objects can also be clicked on like links in HTML pages.

You can create a VRML file by exporting from some 3-D modeling packages or from a specialized VRML editor like gbVRML. The TexNet32 abstractor's assistance package includes an option to export a 3-D term-space display to VRML.

Although VRML is a plain-text format, creating a VRML file with a text editor may be a substantial undertaking. Here is an example of a simple VRML file which contains only a single light source and a yellow sphere:

#VRML V2.0 utf8
Transform {
  children [
    NavigationInfo { headlight FALSE }
    DirectionalLight {
        direction 0 0 -1
    }
    Transform {
      translation 3 0 1
      children [
        Shape {
          geometry Sphere { radius 2.3 }
          appearance Appearance {
            material Material { diffuseColor 1 1 0 }
         }
        }
      ]
    }
  ]
}
If you have a VRML plugin installed in your browser, you can view the scene at 525vml2.wrl.

3-D modelling software can create very long VRML files if, for example, it uses mesh objects like Coordinate3. VRML files that stick to a few simple shapes, such as Sphere and Box, can be quite short.

For a somewhat more complex VRML file, see the term-space model at 525vml3.wrl.

If you're experimenting with creating a VRML file and trying to view it, there are a few things that may be worth noting:

X3D

The X3D Task Group of the Web3D Consortium has developed the Extensible 3D (X3D) graphics specification that is designed to be an improvement on VRML in terms of predictability and standardization and that encodes files in XML. X3D allows developers to support subsets of the specification, called "profiles". Here is an X3D version of the yellow-sphere model:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN"
"http://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile="Immersive">

<Scene>
 <Transform>
  <NavigationInfo
   headlight="false">
  </NavigationInfo>
  <DirectionalLight
   direction="0 0 -1">
  </DirectionalLight>
  <Transform
   translation="3 0 1">
   <Shape>
    <Sphere
     radius="2.3">
    </Sphere>
    <Appearance>
     <Material
      diffuseColor="1 1 0">
     </Material>
    </Appearance>
   </Shape>
  </Transform>
 </Transform>
</Scene>

</X3D>
If you have an X3D browser installed, you can view the file at 525vml2.x3d.

For More Information


Home

Last updated October 25, 2007.
This page maintained by Prof. Tim Craven
E-mail (text/plain only): craven@uwo.ca
Faculty of Information and Media Studies
University of Western Ontario,
London, Ontario
Canada, N6A 5B7