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.
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