Introduction TO VRML

Return to content preparation overview

VRML

Unifeye Design uses VRML 2.0 (VRML 97) as 3D data format. VRML is an abbreviation for Virtual Reality Modeling Language (see http://www.web3d.org/x3d/specifications/vrml/ISO-IEC-14772-VRML97/).
As it can be imported and exported by most DCC and CAD tools it is still a popular data exchange format. The format was
originally designed for the internet and describes 3D scenes. VRML is a human readable format and can easily be edited
with a text editor. The file extension of the VRML format is .wrl or .wrz (compressed VRML). A VRML file consists of nodes
with attributes.

The nodes describe:

  • Geometries
  • Transformations
  • Lighting
  • Interaction
  • Animation
  • Scripting

Sample VRML file.

#VRML V2.0 utf8  
Transform ------ A transform node (translation rotation scale) --------
 {
       translation 0 0 70 ------ that has a translation of 70 units on the z-axis ------
       children Shape ------ containing a Shape node -------
       {
          appearance Appearance ----- which has an appearance node -------
          {
             material Material ----- material node -----
             {
                 emissiveColor 0 0.8 0 ----- emissive color to simulate self ilumination ----- 
             }
          }
          geometry Box ----- A box primitive as a geometry
          {
              size 140 140 140 ------ specified by x,y and z-dimension
          }
       }
 }

A detailed description of all available nodes and their attributes can be found here.

A collection of VRML tutorials can be found here.

Instancing

VRML supports instancing with the DEF/USE mechanism. A node can be defined with the DEF keyword and later be reused
with the USE keyword. This saves memory and can be done for any type of node.

DEF MYBOX Group
{   
     Shape
     {
           geometry Box {size 140 140 140 }
     }
}
USE MYBOX
USE MYBOX
USE MYBOX

Texturing

VRML supports several texturing techniques. For file texturing we recommend to use .bmp, .jpg or the .png format.
The alpha channel of .png files can be used for alphablending. The TextureTransform node allows for scaling and rotating
of the texture.

alphablending.JPG

Materials

The VRML material has several attributes for basic OpenGL shading. The final value for a pixel will be determined by evaluating
a shading equation which depends on the lighting and the material properties. More information can be found here.

Short explanation of material properties:

  • diffuseColor = main color, reflects all light sources depending on the angle of the surface with respect to the light source.
  • ambientIntensity = amount of reflected ambient light
  • emissiveColor = can be used to simulate self illumination (no direct light necessary)
  • specularColor shininess = determines size and color of highlights
  • transparency = opacity of object (0.0 = fully opaque while 1 = fully transparent)

Lighting

VRML offers three types of lights: the point light, directional light and spot light. VRML uses a simple lighting model with a
diffuse, specular and ambient term. The point and spot light illuminate everything according to radius and attenuation. The
directional light illuminates everything on the same level or below, this effect can be used for light linking.

Return to content preparation overview

-- SupportMetaio - 2010-02-23

Topic attachments
I Attachment Action Size Date Who Comment
jpgJPG alphablending.JPG manage 41.8 K 2010-02-24 - 13:58 SupportMetaio alpha blending with .png texture
jpgJPG alphablending1.JPG manage 42.6 K 2010-02-24 - 13:54 SupportMetaio  
jpgJPG alphablending2.JPG manage 81.5 K 2010-02-24 - 13:54 SupportMetaio  
jpgJPG alphablending3.JPG manage 27.8 K 2010-02-24 - 13:54 SupportMetaio  
Topic revision: r4 - 2012-01-03 - 08:39:55 - SupportMetaio
 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback