Pinecoast
 
Basic
Handbag
Cell Phone
Watch
 
Basic 3D Geometry
Messaging
Background
Butterflies
Fog
Color Interpolator
3D Shapes
2D Shapes
Textures
Material
IndexedFaceSet
Layering
Overlay
Shaders 1
Shaders 2
 
     


Basic Examples

The following are a few examples illustrating some basic features of the X3D format. It is useful to compare the source code of the X3D files with the comments given. All of these examples are available in both VRML and X3D formats.

Basic 1 Pencil

Pencil

This simple pencil is made of two shapes, a cone and a cylinder. The shapes are positioned by placing them in Transform nodes. The translation fields of these nodes are then set to appropriate values. The colors are applied by adding Appearance and Material nodes to the Shape nodes and then adjusting the values of the diffuse color field in the Material nodes.

The file for this and other examples can be found in the download package for SwirlX3D.

Basic 2 Traffic Light

Traffic

This example shows how animation can be incorporated into an X3D file. The key elements are a TimeSensor node, ColorInterpolator nodes and Routes connecting them to the colors of the three lights. Time (fraction) messages are sent from the TimeSensor to the ColorInterpolators, which calculate the colors for that time and then send these colors to the diffuse color fields of the Material nodes for each light. Note in the source code how the key values of the ColorInterpolator nodes are adjusted for the length and timing of each light.  

Basic 3 Steam Engine

Steam Engine

This example shows how PositionInterpolator and OrientationInterpolator nodes can be used to add motion to machinery. A PositionInterpolator node moves the pink rod back and forth. PositionInterpolator and OrientationInterpolator nodes translate and rotate the blue bars. An OrientationInterpolator node rotates the large wheel.

Also, the second blue bar is cloned from the first blue bar using the USE command from VRML.

Basic 4 Toy Train

Toy Train

This example shows some of the ways that several files can be used in a single scene. The track is imported into the scene from track.wrl using an Inline node. The wagon is defined as a Proto (user-defined node) in a file called wagon.wrl. This node type is then brought into the scene using the ExternProto mechanism. Two instances of this ExternProto are then created and they are moved about using Interpolator nodes.

The sides of the wagons and the tracks illustrate uses of texture files. The tracks are formed by an Extrusion node whose spine is a large circle.

Download X3D and Vrml Files

 





     
 
 

SwirlX3D Viewer


The SwirlX3D Viewer is a free standalone application for viewing VRML, X3D. It also displays sw3d archives created by the SwPublish program.
The professional version also displays files from other formst such as Collada(DAE), 3DS, OBJ, PLY, STL and IGES (IGS).
For more details ...

 

SwTranslator for VRML, X3D and Collada


The SwTranslator can export VRML, X3D, Collada(DAE), 3DS, OBJ, PLY, STL or IGES files to VRML, X3D or Collada. For X3D this offers a migration path for importing high quality 3D models from a variety of sources. For Collada, it offers an opportunity to bring geometry and animation into this increasingly popular format.
For more details ...