Table of Contents Previous Chapter Summary Chapter Viewpoint Slideshow Javadoc for translated java source Next Chapter Summary X3D Resources

X3D Example Archives: Basic, X3D Specifications

X3D Specification Logo

These examples are used in the X3D Specifications to illustrate correct X3D usage and capabilities.

The X3D Abstract Specification authoritatively defines the functionality of X3D scenes. It specifically describes how geometry rendering and user interaction can be accomplished on any 3D device. Multiple file encodings (.x3d, .x3dv, .x3db) and multiple language bindings (ECMAScript .js, Java .java) can equivalently represent an X3D scene. These examples support five different X3D specifications:

  37 X3D Scenes       Scene Descriptions
AlarmClock Alarm Clock Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.13.3 Alarm clock X3D encodings example: alarm clock plays chimes once each interval.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.13.3 Alarm clock
Chopper Chopper Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.16 Chopper Rotor node provides animation and serves as an ExternProtoDeclare example

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.16 Chopper
ChopperBody Chopper Body Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.16 Chopper X3D encodings example: main body for Chopper example, used as an Inline to show scene composition.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.16 Chopper
ChopperRotor Chopper Rotor Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.16 Chopper X3D encodings example: spinning rotor (with replacable children) Prototype for Chopper example.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.16 Chopper
ClickToAnimate Click To Animate Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.13.2 Click to animate X3D encodings example: click to animate a Box.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.13.2 Click to animate
ColorInterpolator Color Interpolator Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.12 Colour interpolator X3D encodings example: ColorInterpolator demonstration modifies Material color.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.12 Colour interpolator
DirectionalLight Directional Light Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.9 Directional light X3D encodings example: a DirectionalLight source illuminates only the objects in its enclosing grouping node. The light illuminates everything within this coordinate system, including the objects that precede it in the scene graph.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.9 Directional light
ECMAScriptSaiAddDynamicRoutes ECMAScript Sai Add Dynamic Routes Specification reference: X3D language bindings, ISO/IEC 19777-1, Part 1: ECMAScript, B.5 Add dynamic routes Java Scene Authoring Interface (JSAI) scene and source code example that show adding dynamic ROUTEs to a scene.

Specification reference: X3D language bindings, ISO/IEC 19777-1, Part 1: ECMAScript, B.5 Add dynamic routes
ECMAScriptSaiCreateNodes ECMAScript Sai Create Nodes Specification reference: X3D language bindings, ISO/IEC 19777-1, Part 1: ECMAScript, B.3 Create nodes Java Scene Authoring Interface (JSAI) scene and source code example that show using createX3DFromString to create nodes.

Specification reference: X3D language bindings, ISO/IEC 19777-1, Part 1: ECMAScript, B.3 Create nodes
ECMAScriptSaiCreateNodesFromPrototype ECMAScript Sai Create Nodes From Prototype Specification reference: X3D language bindings, ISO/IEC 19777-1, Part 1: ECMAScript, B.6 Create nodes from a prototype Java Scene Authoring Interface (JSAI) scene and source code example that show creation of nodes from a prototype.

Specification reference: X3D language bindings, ISO/IEC 19777-1, Part 1: ECMAScript, B.6 Create nodes from a prototype
ECMAScriptSaiPerFrameNotification ECMAScript Sai Per Frame Notification Specification reference: X3D language bindings, ISO/IEC 19777-1, Part 1: ECMAScript, B.4 Per frame notification Java Scene Authoring Interface (JSAI) scene and source code example that show how to use per frame notification to produce a frame rate annotation.

Specification reference: X3D language bindings, ISO/IEC 19777-1, Part 1: ECMAScript, B.4 Per frame notification
ECMAScriptSaiTouchSensorIsOverEvent ECMAScript Sai Touch Sensor Is Over Event Specification reference: X3D language bindings, ISO/IEC 19777-1, Part 1: ECMAScript, B.2 touchSensor isOver event Java Scene Authoring Interface (JSAI) scene and source code example that demonstrate a scripted response to a TouchSensor isOver event by changing the color of a Box from blue to red.

Specification reference: X3D language bindings, ISO/IEC 19777-1, Part 1: ECMAScript, B.2 touchSensor isOver event
Elevator Elevator Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.18 Elevator X3D encodings example: example of animating the camera by depicting an elevator to ease access to a multi-story building. For this example, a 2 story building is shown and it is assumed that the elevator is already at the ground floor. To go up, the user just steps onto the elevator platform. A ProximitySensor fires and starts the elevator up automatically. Additional features such as call buttons for outside the elevator, elevator doors, and floor selector buttons could be added to make the elevator easier to use.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.18 Elevator
ExecutionModel Execution Model Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.19 Execution model X3D encodings example: execution model demonstrated. Click ball to see script-generated text appear.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.19 Execution model
ExtrusionEdgeCases Extrusion Edge Cases Specification reference: X3D encodings, ISO/IEC 19775-1.4, Part 1: Architecture and base components, Clause 13 Geometry3D component, Topic 13.3.5 Extrusion, Section 13.3.5.4 Special cases Scene incorporating extrusion edge cases

Specification reference: X3D encodings, ISO/IEC 19775-1.4, Part 1: Architecture and base components, Clause 13 Geometry3D component, Topic 13.3.5 Extrusion, Section 13.3.5.4 Special cases
ExtrusionFigureX3dSpecification Extrusion Figure X3D Specification Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Figure 13.5 - Spine-aligned cross-section plane at a spine point. X3D Extrusion spine-aligned cross-section plane (SCP) at a spine point. Modeled after Figure 13.5 in X3D Specification.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Figure 13.5 - Spine-aligned cross-section plane at a spine point.
GeometricProperties Geometric Properties Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.6 Geometric properties X3D encodings example: simple demonstration of geometric-property nodes.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.6 Geometric properties
GuidedTour Guided Tour Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.17 Guided tour X3D encodings example: provides control of the viewpoint through use of a script. This is useful for things such as guided tours, merry-go-round rides, and transportation devices such as buses and elevators. These next two examples show a couple of ways to use this feature. This example is a simple guided tour through the world. Upon entry, a guide orb hovers in front of the viewer. Click on this and a tour through the world begins. The orb follows the user around on his tour. A ProximitySensor ensures that the tour is started only if the user is close to the initial starting point. Note that this is done without scripts thanks to the touchTime output of the TouchSensor.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.17 Guided tour
Instancing Instancing Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.3 Instancing (sharing) X3D encodings example: demonstrate reuse of content instances through DEF, USE.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.3 Instancing (sharing)
JavaSaiAddDynamicRoutes Java Sai Add Dynamic Routes Specification reference: X3D language bindings, ISO/IEC 19777-2, Part 2: Java, D.5 Add dynamic routes Java Scene Authoring Interface (JSAI) scene and source code example that show adding dynamic ROUTEs to a scene.

Specification reference: X3D language bindings, ISO/IEC 19777-2, Part 2: Java, D.5 Add dynamic routes
JavaSaiCreateNodes Java Sai Create Nodes Specification reference: X3D language bindings, ISO/IEC 19777-2, Part 2: Java, D.3 Create nodes Java Scene Authoring Interface (JSAI) scene and source code example that show using createX3DFromString to create nodes.

Specification reference: X3D language bindings, ISO/IEC 19777-2, Part 2: Java, D.3 Create nodes
JavaSaiCreateNodesFromPrototype Java Sai Create Nodes From Prototype Specification reference: X3D language bindings, ISO/IEC 19777-2, Part 2: Java, D.6 Create nodes from a prototype Java Scene Authoring Interface (JSAI) scene and source code example that show creation of nodes from a prototype.

Specification reference: X3D language bindings, ISO/IEC 19777-2, Part 2: Java, D.6 Create nodes from a prototype
JavaSaiPerFrameNotification Java Sai Per Frame Notification Specification reference: X3D language bindings, ISO/IEC 19777-2, Part 2: Java, D.4 Per frame notification Java Scene Authoring Interface (JSAI) scene and source code example that show how to use per frame notification to produce a frame rate annotation.

Specification reference: X3D language bindings, ISO/IEC 19777-2, Part 2: Java, D.4 Per frame notification
JavaSaiTouchSensorIsOverEvent Java Sai Touch Sensor Is Over Event Specification reference: X3D language bindings, ISO/IEC 19777-2, Part 2: Java, D.2 TouchSensor isOver event Java Scene Authoring Interface (JSAI) scene and source code example that demonstrate a scripted response to a TouchSensor isOver event by changing the color of a Box from blue to red.

Specification reference: X3D language bindings, ISO/IEC 19777-2, Part 2: Java, D.2 TouchSensor isOver event
LevelOfDetail Level Of Detail Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.11 Level of detail X3D encodings example: LevelOfDetail demonstration.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.11 Level of detail
PointSet Point Set Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.10 PointSet X3D encodings example: PointSet demonstration.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.10 PointSet
Prototype Prototype Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.4 Prototype example X3D encodings example: defining a Prototype, demonstration of IS/connect definitions.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.4 Prototype example
PrototypesPlus Prototypes Plus Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.7 Prototypes and alternate representations X3D encodings example: using an externally defined prototype.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.7 Prototypes and alternate representations
RedSphereBlueBox Red Sphere Blue Box Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.2 Simple example X3D encodings example: show simple Shapes, including different Materials and geometry.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.2 Simple example
RefractiveMaterial Refractive Material Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.7 Prototypes and alternate representations X3D encodings example: create new node RefractiveMaterial for example PrototypesPlus.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.7 Prototypes and alternate representations
Robot Robot Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.15 Robot X3D encodings example: Robot. Seek or zoom in towards the robot to start a simple animation sequence.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.15 Robot
Rotor Rotor Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.16 Chopper X3D specification example showing a spinning helicopter rotor that is used by the Chopper model.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.16 Chopper
Scripting Scripting Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.5 Scripting example X3D encodings example: this Script node decides whether or not to open a bank vault given openVault and combinationEntered messages. To do this, it remembers whether or not the correct combination has been entered. The Script node combined with a Sphere, a TouchSensor and a Sound node to show how is works. When the pointing device is over the sphere, the combinationEntered eventIn of the Script is sent. Then, when the Sphere is touched (typically when the mouse button is pressed) the Script is sent the openVault eventIn. This generates the vaultUnlocked eventOut which starts a click sound.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.5 Scripting example
ShuttlesAndPendulums Shuttles And Pendulums Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.14 Shuttles and pendulums X3D encodings example: animation of shuttle and pendulum prototype nodes.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, Annex C.14 Shuttles and pendulums
StringArrayEncodingExamples String Array Encoding Examples Specification reference: X3D encodings, ISO/IEC 19776-2 v3.3, Part 2: Classic VRML encoding, 5.15 SFString and MFString Demonstrate simple X3D MFString (string array) encoding.

Specification reference: X3D encodings, ISO/IEC 19776-2 v3.3, Part 2: Classic VRML encoding, 5.15 SFString and MFString
TriangleStripSetFigure Triangle Strip Set Figure Specification reference: X3D Abstract Specification, Part 1: Architecture and base components, Topic 11.4.14 TriangleStripSet X3D specification example for TriangleStripSet.

Specification reference: X3D Abstract Specification, Part 1: Architecture and base components, Topic 11.4.14 TriangleStripSet
X3dHeaderPrototypeSyntaxExamples X3D Header Prototype Syntax Examples Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, 4.3 XML file syntax X3D scene header and prototype syntax examples. This example header indicates that the content is XML encoded, follows the Interactive Profile and explicitly lists additional necessary components. The X3D header may also contain additional semantic information. Used for specification EXAMPLE excerpts in 19776:1 XML Encoding.

Specification reference: X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, 4.3 XML file syntax

Online at http://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications

Validate XHTML 1.1

Master source-code model archive is under subversion control at
http://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/X3dSpecifications

The X3D Resources: Examples page and Savage Developers Guide provide more information about the production of this archive.

Table of Contents Previous Chapter Summary Chapter Viewpoint Slideshow Javadoc for translated java source Next Chapter Summary X3D Resources