Full HTML for

Basic foilset VRML 2 Basic Concepts and Definitions

Given by Zeynep Ozdemir, Rob Baker, Meryem Ispirli, Geoffrey C. Fox at CPS616 -- Information Track of CPS on Spring Semester 98. Foils prepared March 4 1998
Outside Index Summary of Material


See VRML Resources including many Examples Specifications and Tutorialsbr>
See VRML Consortium including VRML97 Specification and News
What is VRML2.0 and VRML97
Status of VRML Browsers
Features of VRML97 with changes from VRML1.0 -- Deletions and Additions
VRML97 File Format
Nodes, Fields, Events, Shapes, Routes, Sensors
Detailed Discussion of Specific Nodes without going into Scripting issues

Table of Contents for full HTML of VRML 2 Basic Concepts and Definitions

Denote Foils where Image Critical
Denote Foils where Image has important information
Denote Foils where HTML is sufficient
denotes presence of Additional linked information which is greyed out if missing

1 VRML World and NPAC Resources for Foil 1 CPS616 Spring 98 Computational Science For the Information Age
2 VRML World and NPAC Resources for Foil 2 VRML 97 or 2.0 The Virtual Reality Modeling Language
3 VRML World and NPAC Resources for Foil 3 VRML 2.0 The Virtual Reality Modeling Language
4 VRML World and NPAC Resources for Foil 4 What is VRML97?
5 History of VRML from wired VRML Site
6 Overview of VRML1 Language Details - I
7 Overview of VRML Language Details - II
8 VRML1.0 to VRML2.0 Transition
9 VRML2.0 Browsers VRML2.0 Browsers - I
10 Architecture of a VRML2.0 Browser
11 VRML2.0 Browsers - II
12 VRML2.0 Browsers -III
13 Key Features of VRML 2.0
14 VRML File Structure
15 Simple VRML2.0 world with 2 Shapes VRML File Header
16 Local and External Simple VRML2.0 world with 2 Shapes for Foil 16 A Sample VRML File - I
17 Local and External Simple VRML2.0 world with 2 Shapes for Foil 17 A Sample VRML File - II
18 Local and External Simple VRML2.0 world with 2 Shapes for Foil 18 A Sample VRML File - III
19 Local and External Simple VRML2.0 world with 2 Shapes for Foil 19 A Sample VRML Display - simpleworld.wrl - IV
20 VRML2.0 Nodes - I
21 Nodes - Atrributes - II
22 Nodes - ExposedFields -III
23 Fields and Events
24 Definition of Fields and Events Fields
25 Definition of Fields and Events Field Types - I
26 Definition of Fields and Events Field Types - II
27 Definition of Fields and Events Field Types - III
28 Definition of Fields and Events Events
29 Definition of Fields and Events Naming Conventions for Fields/Events
30 Example of DEF and USE from www.vrml.org Defining Node Names
31 Coordinate System for VRML
32 Scope of Nodes in VRML2
33 VRML2.0 Nodes VRML 2.0 Nodes (Summary of New Features)
34 Summary VRML2.0 Node Types - I
35 VRML2.0 Grouping Nodes Summary VRML2.0 Node Types - Grouping - II
36 Summary Node Types - Browser Information - III
37 Summary Node Types - Browser Information - IV
38 Summary Node Types - Sound/Light - V
39 Summary Node Types - Shape/Geometry - VI
40 VRML2.0 Geometry Nodes Summary Node Types - Geometry - VII
41 Summary Node Types - Appearance/Properties - VII
42 Definition and Example of Scripting in VRML97 for Foil 42 Summary Node Types - Scripting - VIII
43 VRML2.0 Sensor Nodes Summary Node Types - Sensors - VIII
44 Summary Node Types - Sensors - IX
45 Summary Node Types - Sensors - X
46 ColorInterpolator Example and Definition for Foil 46 Summary Node Types - Interpolators - X
47 OrientationInterpolator Example and Definition for Foil 47 Summary Node Types - Interpolators - XI
48 PositionInterpolator Example and Definition for Foil 48 Summary Node Types - Interpolators - XII
49 VRML2.0 Field and Event Reference New Field Types - XIII
50 Deleted Node Types - XIII
51 Deleted Node Types - XV
52 VRML97 Time sensor Examples and Definitions of all Sensors for Foil 52 Summary of Sensors Interaction with the User
53 Summary: Scripts and Interpolators - I Behavior and Animation
54 Summary: Scripts and Interpolators - II Behavior and Animation
55 Sound Example and Definition for Foil 55 Summary: Sound in VRML2.0
56 VRML2.0 Geometry Nodes Geometry Nodes Polygonal Description of the World
57 VRML2.0 Shape Node Shapes
58 Sample VRML2.0 File for Shapes and Groups Shape and Appearance Node Syntax
59 VRML2.0 Geometry Nodes 4 Primitive Geometries
60 Sample VRML2.0 File for Shapes and Groups Shape Example - I
61 Sample VRML2.0 File for Shapes and Groups Shape Example - II
62 Sample VRML2.0 File for Shapes and Groups Grouping Shapes -- Children
63 4 Sample Shapes on a Pedestal and Pedestal itself for Foil 63 A Sample file for Shapes & Groups
64 VRML2.0 Group Node Definition Group Node
65 Group Node Example
66 VRML2.0 Example of Billboard Group Billboard Node
67 VRML2.0 Example of Billboard Group A Sample Billboard Group
68 Events and Routes
69 Definition and Example of Execution Model for Foil 69 Execution Model for Event processing
70 Definition and Example of Execution Model for Foil 70 Diagram of Execution Model for Event processing
71 ROUTE - I
72 ROUTE - II
73 VRML2.0 Sensor Nodes Definition Sensor Nodes - I
74 Time Sensor Definition and Examples for Foil 74 Sensor Nodes - II
75 Prototype Definition and Examples for Foil 75 Prototypes - I
76 Prototype Definition and Examples for Foil 76 Prototypes - II
77 Prototype Definition and Examples for Foil 77 Prototype Sample
78 Definition and Examples of IS/Prototypes for Foil 78 IS Statement
79 VRML2.0 Transform Node Definition Transform Node
80 Simple Example also used for Shapes from www.vrml.org site Transform Node Example
81 Transform Definition and Rotation Example for Foil 81 Rotation Field in Transform - I
82 Transform Definition and Rotation Example for Foil 82 Rotation Field - II
83 Transform Definition and Rotation Example for Foil 83 Rotation Example - I
84 Transform Definition and Rotation Example for Foil 84 Rotation Example - II
85 VRML2.0 Example of Scale Scale Field in Transform
86 VRML2.0 Example of Scale Scale Example - I
87 VRML2.0 Example of Scale Scale Example - II
88 VRML2.0 Example of Scale Scale Example - III
89 VRML2 Material Definition and Examples for Foil 89 Material Node - I
90 VRML2 Material Definition and Examples for Foil 90 Material Node - II
91 VRML2 Material Definition and Examples for Foil 91 Material Node - III
92 VRML2 Material Definition and Examples for Foil 92 Material Node - IV
93 VRML2 Material Definition and Examples for Foil 93 Material Node - V
94 VRML2 Material Definition and Examples for Foil 94 A Sample World Using Appearance -Material
95 Bakers Example - Spacial Sound w/ Touch Sensor, & Keyframe Animation Animation - I
96 Example and Definition of Interpolaters for Foil 96 Animation - II
97 Definition and Examples of Position Interpolatoers for Foil 97 PositionInterpolator - I
98 PositionInterpolator - II
99 VRML2.0 Example of PositionInterpolator and Inline An Example Using PositionInterpolators
100 VRML2.0 Example of PositionInterpolator and Inline In Header of doorway.wrl -- What it does
101 VRML2.0 Example of PositionInterpolator and Inline The First Stair in doorway.wrl
102 VRML2.0 Example of PositionInterpolator and Inline Animation Strategy in doorway.wrl
103 VRML2.0 Example of PositionInterpolator and Inline Animation Code for Stair1 in doorway.wrl
104 OrientationInterpolator Example and Definition for Foil 104 OrientationInterpolator
105 ColorInterpolator Example and Definition for Foil 105 ColorInterpolator
106 VRML2.0 ScalarInterpolator Node ScalarInterpolator
107 VRML2.0 NormalInterpolator Node NormalInterpolator Node
108 Handling User Interactions - I
109 Handling User Interactions - II
110 TimeSensor Examples and Definition for Foil 110 TimeSensor - I
111 Bakers Example - Elevation Grid, Color Interpolation, Billboard, and Movie Texture TimeSensor - II
112 Examples and Definition of TouchSensor for Foil 112 TouchSensor - I
113 Examples and Definition of TouchSensor for Foil 113 TouchSensor - II
114 Definition and 2 Examples of a PlaneSensor for Foil 114 PlaneSensor
115 Definition and 2 Examples of a SphereSensor for Foil 115 SphereSensor
116 Definition and 2 Examples of a CylinderSensor for Foil 116 CylinderSensor
117 VisibilitySensor Definitions for Foil 117 VisibilitySensor Node - I
118 VisibilitySensor Definitions for Foil 118 VisibilitySensor Node - II
119 Definition and 2 Examples ProximitySensor for Foil 119 ProximitySensor Node - I
120 Definition and 2 Examples ProximitySensor for Foil 120 ProximitySensor Node - II
121 Definition and Example Collision Node for Foil 121 Collision Node - I
122 Definition and Example Collision Node for Foil 122 Collision Node - II
123 Treatment of Multiple Sensors
124 VRML2.0 Example of Inline:Dinette and Components as well as Pyramid for Foil 124 Inline Node
125 VRML2.0 Example of Inline:Dinette and Components as well as Pyramid for Foil 125 A Sample Inlined File
126 VRML97 Examples and Definition of Anchor for Foil 126 Linking Different VRML Worlds
127 VRML97 Examples and Definition of Anchor for Foil 127 An Example of Anchor Node
128 Definition and Example of Text Node for Foil 128 Text Node Definition
129 Definition and Example of Text Node for Foil 129 Text Node Notes
130 Definition and Example of FontStyle for Foil 130 Font Style Node Definition - I
131 Definition and Example of FontStyle for Foil 131 Font Style Node - II
132 Definition and Example of FontStyle for Foil 132 Font Style Node - II
133 Bakers Example - Collison, AudioClip, PointLight, Texture map, and Background Lights - I
134 Definition and Example PointLight for Foil 134 Lights - Pointlight Node
135 Definition and Example PointLight for Foil 135 PointLight Node Fields - I
136 Definition and Example PointLight for Foil 136 PointLight Node Fields - II
137 Definition and Example of DirectionalLight for Foil 137 DirectionalLight Node
138 VRML2.0 SpotLight Node SpotLight Node - I
139 VRML2.0 SpotLight Node SpotLight Node - II
140 Defining VRML shapes with points, lines, and faces
141 Example and Definition of PointSet in VRML97 for Foil 141 PointSet Node
142 IndexedLineSet Definition Binding Colors to points, lines, and faces
143 VRML2.0 IndexedLineSet Fields IndexedLineSet Fields - I
144 VRML2.0 IndexedLineSet Fields IndexedLineSet Fields - II
145 IndexedFaceSet Node Examples and Definition for Foil 145 IndexedFaceSet Node - I
146 2 examples of Pyramids for Foil 146 IndexedFaceSet Pyramid Example I
147 2 examples of Pyramids for Foil 147 IndexedFaceSet Pyramid Example II
148 2 examples of Pyramids for Foil 148 IndexedFaceSet Pyramid Example III
149 IndexedFaceSet Node Examples and Definition for Foil 149 IndexedFaceSet Node - II
150 IndexedFaceSet Node Examples and Definition for Foil 150 IndexedFaceSet Node - III
151 IndexedFaceSet Node Examples and Definition for Foil 151 IndexedFaceSet Node - IV
152 Bakers Example - Color, Instancing, Grouping, Animation, Color Interpolation Color Node
153 VRML2.0 Example of ElevationGrid ElevationGrid Node
154 VRML2.0 Example of ElevationGrid Example of ElevationGrid Node
155 VRML2.0 Example of Extrusion Shape Extrusion Node
156 VRML2.0 Example of Extrusion Shape Example of Extrusion Node
157 Shading and Normals
158 VRML2.0 Example of Texture for Lego Car Texture - I
159 Texture - II
160 VRML2.0 Example of ElevationGrid ImageTexture
161 VRML2.0 Example of Texture Map An Example ImageTexture
162 VRML2.0 PixelTexture Node PixelTexture Node
163 Bakers Example - Elevation Grid, Color Interpolation, Billboard, and Movie Texture MovieTexture Node - I
164 Bakers Example - Elevation Grid, Color Interpolation, Billboard, and Movie Texture MovieTexture Node - II
165 Texture Mapping with S and T
166 Controlling Detail and Rendering Time
167 Example and Definition of Levelof Detial LOD Node for Foil 167 VRML97 Level Of Detail LOD Node - I
168 Example and Definition of Levelof Detial LOD Node for Foil 168 VRML97 Level Of Detail LOD Node - II
169 Example and Definition of Levelof Detial LOD Node for Foil 169 Fields in a LOD Node
170 Sound Effects
171 Bakers Example - Collison, AudioClip, PointLight, Texture map, and Background AudioClip Node - I
172 Bakers Example - Collison, AudioClip, PointLight, Texture map, and Background AudioClip Node - II
173 Bakers Example - Spacial Sound w/ Touch Sensor, & Keyframe Animation Sound Node - I
174 Bakers Example - Spacial Sound w/ Touch Sensor, & Keyframe Animation Fields in Sound Node - II
175 Bakers Example - Collison, AudioClip, PointLight, Texture map, and Background Adding Background to the VRML World - I
176 Bakers Example - Collison, AudioClip, PointLight, Texture map, and Background The Background Scenarios
177 Bakers Example - Collison, AudioClip, PointLight, Texture map, and Background Adding Background to the VRML World - II
178 Bakers Example - Fog node also w/ Proximity sensors Creating A Virtual Atmosphere Effect
179 Definition and 2 Examples of Viewpoint Nodes for Foil 179 Viewpoints -- Overview
180 Definition and 2 Examples of Viewpoint Nodes for Foil 180 Fields in Viewpoint Node - I
181 Definition and 2 Examples of Viewpoint Nodes for Foil 181 Viewpoint Node - II
182 Avatars
183 Bakers Example - Navigation Information w/ Viewpoint binding, and Trans gifs NavigationInfo Node - I
184 Bakers Example - Navigation Information w/ Viewpoint binding, and Trans gifs NavigationInfo Node - II

Outside Index Summary of Material



HTML version of Basic Foils prepared March 4 1998

Foil 1 CPS616 Spring 98 Computational Science For the Information Age

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML World and NPAC Resources for Foil 1
VRML(97 or 2.0)
The Virtual Reality Modeling Language
Instructor : Dr. Geoffrey Fox
Material by Rob Baker, Meryem Ispirli, Zeynep Ozdemir, Wojtek Furmanski
VRML2.0/ VRML 97 Specification :
VRML2.0 Resources (NPAC) :

HTML version of Basic Foils prepared March 4 1998

Foil 2 VRML 97 or 2.0 The Virtual Reality Modeling Language

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML World and NPAC Resources for Foil 2
The Virtual Reality Modeling Language(VRML) is a file format for describing 3D shapes and interactive worlds and objects. It may be used in conjunction with the World Wide Web.
The most exiting feature of VRML is that it enables you to create dynamic worlds and sensory-rich virtual environments on the internet.

HTML version of Basic Foils prepared March 4 1998

Foil 3 VRML 2.0 The Virtual Reality Modeling Language

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML World and NPAC Resources for Foil 3
VRML1.0 Specification was based on the Open Inventor file format from Silicon Graphics and developed by a team.
VRML2.0 (Moving Worlds) Specification has significantly more interactive capabilities. It was designed by the Silicon Graphics VRML team with contributions from Sony Research and Mitra.
VRML 2.0 was reviewed by the VRML moderated email discussion group (www-vrml@wired.com), and later adopted and endorsed by most 3D graphics and web browser vendors.

HTML version of Basic Foils prepared March 4 1998

Foil 4 What is VRML97?

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML World and NPAC Resources for Foil 4
VRML97 is the name of the ISO VRML standard. It is almost identical to VRML 2.0, but with numerous improvements to the specification document and a few minor functional differences.
VRML97 was officially approved Jan 26, 1998 by ISO (International Organization for Standardization).

HTML version of Basic Foils prepared March 4 1998

Foil 5 History of VRML from wired VRML Site

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
VRML was conceived in the spring of 1994 at the first annual World Wide Web Conference in Geneva, Switzerland.
Tim Berners-Lee and Dave Raggett organized a Birds-of-a-Feather (BOF) session to discuss Virtual Reality interfaces to the World Wide Web.
Several BOF attendees described projects already underway to build three dimensional graphical visualization tools which interoperate with the Web.
Attendees agreed on the need for these tools to have a common language for specifying 3D scene description and WWW hyperlinks -- an analog of HTML for virtual reality.
The term Virtual Reality Markup Language (VRML) was coined, and the group resolved to begin specification work after the conference.
The word 'Markup' was later changed to 'Modeling' to reflect the graphical nature of VRML.

HTML version of Basic Foils prepared March 4 1998

Foil 6 Overview of VRML1 Language Details - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
VRML1 defines scene graphs which are defined hierarchically as a set of nodes
Nodes fall into one of 36 types arranged into broad classes -- shape, geometry/material, transformation, camera, lighting, group and WWWInline
The state of a graph (color, position, rotation etc.) are "advanced" (e.g. transformation matrices are multiplied) when each node is encountered
  • separators are used to limit the effect of a given node to a block defined by { }
  • Thus the order in which nodes appear in file is very significant

HTML version of Basic Foils prepared March 4 1998

Foil 7 Overview of VRML Language Details - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Node instances can be given names to allow them to be replicated or otherwise referenced
Nodes have attributes (properties or parameters if you prefer) which are called fields
Fields have names for specific node types which have mnemonic value
However there are a set of global field types ( single or multiple(vector), floating or integer etc.) and each field is assigned a particular type and this implies format that must be used

HTML version of Basic Foils prepared March 4 1998

Foil 8 VRML1.0 to VRML2.0 Transition

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
After an Interesting "competition", a new standard VRML2.0 was adopted in May 1996. After some uncertainty, it appears that this standard will be accepted by major players
  • Good VRML2.0 browsers are (starting Spring 97) available
Conceptually it is in most areas similar to VRML1.0 but there are many changes in detail and VRML1.0 is NOT a subset of VRML2.0 (MOST of language is changed)
Major goal of VRML2.0 was to support dynamic 3D worlds where components of world move relative to each other and interact together
  • This is achieved by events in VRML nodes which are linked by "routes" and invoked by time stamped animations or Java/JavaScript programs

HTML version of Basic Foils prepared March 4 1998

Foil 9 VRML2.0 Browsers - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Browsers
CosmoPlayer - Silicon Graphics
  • 2.0 Browser for Win95, WinNT, IRIX 5.3 and IRIX 6.2
WorldView - Intervista Software
  • 2.0 Browser for Win95, WinNT
Liquid Reality - DimensionX
  • 2.0 Browser for Win95, WinNT, IRIX, Sun, Linux
Community Place - Sony
  • 2.0 Browser for Win95, WinNT

HTML version of Basic Foils prepared March 4 1998

Foil 10 Architecture of a VRML2.0 Browser

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Figure 1: Conceptual model of a VRML browser

HTML version of Basic Foils prepared March 4 1998

Foil 11 VRML2.0 Browsers - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
The three main components of the browser are:
Parser, Scene Graph, and Audio/Visual Presentation.
  • The Parser component reads the VRML file and creates a Scene Graph.
  • The Scene Graph component consists of a Transform Hierarchy (the nodes) and a ROUTE Graph (the connections between nodes).
  • The Scene Graph also includes an Execution Engine that processes events, reads and edits the ROUTE Graph, and makes changes to the Transform Hierarchy (nodes).

HTML version of Basic Foils prepared March 4 1998

Foil 12 VRML2.0 Browsers -III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
User input generally affects sensors and navigation, and thus is wired to the ROUTE Graph component (sensors) and the Audio/Visual Presentation component (navigation).
The Audio/Visual Presentation component performs the graphics and audio rendering of the Transform Hierarchy that feeds back to the user.

HTML version of Basic Foils prepared March 4 1998

Foil 13 Key Features of VRML 2.0

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
VRML allows you to do
  • Create 3D scenes
  • Animate objects in your world, making them move
  • Play sounds and movies within your worlds
  • Allow users to interact with your worlds
  • Control and enhance worlds with scripts, small programs(written in java or javascript) you create to act on your VRML worlds

HTML version of Basic Foils prepared March 4 1998

Foil 14 VRML File Structure

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
A VRML file is a textural description of your VRML world. VRML file consists of the following parts
  • The VRML header
  • Comments - notes to yourself
  • Nodes - nuggets of scene information
  • Fields - node attributes you can change
  • Values - attribute values
  • Node Names - names for reusable nodes
  • Prototypes - Build your own data structures
  • Shapes, interpolators, sensors, and scripts build world
  • Routes - Link events together for coordinated action

HTML version of Basic Foils prepared March 4 1998

Foil 15 VRML File Header

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Simple VRML2.0 world with 2 Shapes
The VRML file header is the only required part. This header should be the first line of the file.
#VRML V2.0 utf8
  • This tells that file is a VRML file, prepared according to 2.0 specifications, and uses the international UTF-8 character set.
Any lines begining with # are comment lines.

HTML version of Basic Foils prepared March 4 1998

Foil 16 A Sample VRML File - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Local and External Simple VRML2.0 world with 2 Shapes for Foil 16(VRML and Display from www.vrml.org)
#VRML V2.0 utf8
Transform { # Completes on later foil
children [ # Closing ] two foils later!
NavigationInfo { headlight FALSE }
# We'll add our own light
DirectionalLight { # First child
direction 0 0 -1 # Light illuminating the scene
}

HTML version of Basic Foils prepared March 4 1998

Foil 17 A Sample VRML File - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Local and External Simple VRML2.0 world with 2 Shapes for Foil 17(VRML and Display from www.vrml.org)
Transform { # Second child - a red sphere
translation 3 0 1
children [
Shape { geometry Sphere { radius 2.3 }
appearance Appearance {
material Material { diffuseColor 1 0 0 } # Red
}
}
]
}

HTML version of Basic Foils prepared March 4 1998

Foil 18 A Sample VRML File - III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Local and External Simple VRML2.0 world with 2 Shapes for Foil 18(VRML and Display from www.vrml.org)
Transform { # Third child - a blue box
translation -2.4 .2 1
rotation 0 1 1 .9
children [
Shape { geometry Box {}
appearance Appearance {
material Material { diffuseColor 0 0 1 } # Blue }
}
]
}
] # end of children for world from two foils earlier
} # ends grouping from two foils earlier

HTML version of Basic Foils prepared March 4 1998

Foil 19 A Sample VRML Display - simpleworld.wrl - IV

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Local and External Simple VRML2.0 world with 2 Shapes for Foil 19(VRML and Display from www.vrml.org)
[simpleworld.wrl]
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/simpleworld.wrl

HTML version of Basic Foils prepared March 4 1998

Foil 20 VRML2.0 Nodes - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
A VRML file contains nodes that describe shapes and their properties in your 3D world. By using these properties it is possible to describe shapes(box,cylinder,sphere,etc.), colors, lights, viewpoints, animation timers, sensors, interpolators, etc.
Nodes generally contains the following properties
  • The type of node (required)
  • A set of curly braces should enclose the node definition.
  • Various fields related to the node and their values.

HTML version of Basic Foils prepared March 4 1998

Foil 21 Nodes - Atrributes - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Each node has attributes.
Attributes can be Field or Event.
Both of them also have a Field Type.
There are two kinds of fields: field and exposedField.
fields define the initial values for the node's state, but cannot be changed and are considered private.

HTML version of Basic Foils prepared March 4 1998

Foil 22 Nodes - ExposedFields -III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
ExposedFields also define the initial value for the node's state, but are public and may be modified by other nodes.
Each exposedField attribute has an associated implicit set_ eventIn and _changed eventOut so that exposed fields may be connected using ROUTE statements, and may be read and/or written by Script nodes
exposedField foo is equivalent to:
  • eventIn set_foo # recieves information that then
  • field foo # sets a value in this field foo
  • eventOUT foo_changed # and generates a foo_changed eventOut

HTML version of Basic Foils prepared March 4 1998

Foil 23 Fields and Events

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Each node has specific fields and events
  • Field: A stored value (parameter)
  • EventIn: An event node that can receive data
  • EventOut: An event node that can send
Figure 2 : Fields and Events

HTML version of Basic Foils prepared March 4 1998

Foil 24 Fields

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition of Fields and Events
Fields define the attributes of a node.
Fields are optional within nodes since each field has a default value that is used by your VRML browser if you don not specify a value.
Field values define attributes like color, size, or position, and every value is of a specific field type, which describes the kind of values allowed in the field.

HTML version of Basic Foils prepared March 4 1998

Foil 25 Field Types - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition of Fields and Events
SFBool : Boolean or logical values. TRUE or FALSE
SFColor/MFColor : A group of three floating point values such as SFFloat/MFFloat. Describes the red, green, and blue component of the color. Values should be between 0 and 1.
SFFloat/MFFloat : Floating-point values. Examples: -90.99, 89.0.
  • field height of the Cylinder object has this type.

HTML version of Basic Foils prepared March 4 1998

Foil 26 Field Types - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition of Fields and Events
SFImage : A list of values describing the colors of a digital picture. It can be used to create a surface texture to color the shape.
SFInt32/MFInt32 : 32-bit integer values.
SFNode/MFNode : A VRML node such as Box.
SFRotation/MFRotation : A group of four floating values. The first three values define a rotation axis. The last value is a rotation angle measured in radians. This helps to define the orientation of a shape.

HTML version of Basic Foils prepared March 4 1998

Foil 27 Field Types - III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition of Fields and Events
SFString/MFString : A list of characters enclosed within quotation marks(").
SFTime : A floating-point value. Gives a real world absolute time, measured in seconds since 12.00 midnight, GMT, January 1, 1970. It allows to define the start time and end time of any animation.
SFVec2f/MFVec2f : 2-D floating point vector. This allows to specify a 2-D position.
SFVec3f/MFVec3f : 3-D floating point vector. This allows to specify a 3-D position.

HTML version of Basic Foils prepared March 4 1998

Foil 28 Events

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition of Fields and Events
Nodes can receive a number of incoming set_ events, denoted as eventIn, (such as set_position, set_color, and set_on), which typically change the node. Incoming events are data messages sent by other nodes to change some state within the receiving node.
Nodes can also send out a number of _changed events, denoted as eventOut, which indicate that something in the node has changed (for example, position_changed, color_changed, on_changed).
The exposedField keyword may be used as a short-hand for specifying that a given field has a set_ eventIn that is directly wired to a field value and a _changed eventOut.

HTML version of Basic Foils prepared March 4 1998

Foil 29 Naming Conventions for Fields/Events

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition of Fields and Events
The rules for naming fields, exposedFields, eventOuts and eventIns for the built-in nodes are as follows:
  • All names containing multiple words start with a lower case letter and the first letter of all subsequent words are capitalized (e.g. bboxCenter), with the exception of get_ and _changed described below.
  • All eventIns have the prefix set_ - with the exception of the addChildren and removeChildren eventIns.
  • All eventOuts have the suffix _changed appended - with the exception of eventOuts of type SFBool. Boolean eventOuts begin with the word is (e.g. isFoo) for better readability.
  • All eventIns and eventOuts of type SFTime do not use the set_ prefix or _changed suffix

HTML version of Basic Foils prepared March 4 1998

Foil 30 Defining Node Names

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Example of DEF and USE from www.vrml.org
Nodes can be named, and used repeatedly
  • DEF MyCylinder Shape { }
  • USE MyCylinder
DEF node-name node-type {}
  • node-names are a sequence of characters and they are case sensitive.
  • Do not used the names which are already in use for specific purposes as a node name.
USE node-name
  • It is possible to use the same node in the same file multiple times without repeating the definition. There is no limit for instancing the same node by using USE.

HTML version of Basic Foils prepared March 4 1998

Foil 31 Coordinate System for VRML

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
VRML uses a cartesian, right-handed, 3-dimensional coordinate system.
By default, objects are projected onto a 2-dimensional device by projecting them in the direction of the positive Z axis, with the positive X axis to the right and the positive Y axis up.
A camera or modeling transformation may be used to alter this default projection.
The standard unit for lengths and distances specified is meters.
The standard unit for angles is radians.

HTML version of Basic Foils prepared March 4 1998

Foil 32 Scope of Nodes in VRML2

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Hierarchical file inclusion enables the creation of arbitrarily large, dynamic worlds.
Therefore, VRML ensures that each file is completely described by the objects and files contained within it and that the effects of each file are strictly scoped by the file and the spatial limits of the objects defined in the file.
Otherwise, the accumulation of files into larger worlds would produce unscalable results (as each added world produces global effects on all other worlds).
  • For example, light sources have the potential of global effect since light energy theoretically does not dissipate to zero.
  • And, if the earth file contains 100 city files each containing 100 lights each affecting all objects in the world, the lighting calculations would quickly become intractable.
  • Therefore, in order to prevent global effects, light source objects are scoped by either a maximum radius or by location within the file.

HTML version of Basic Foils prepared March 4 1998

Foil 33 VRML 2.0 Nodes (Summary of New Features)

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Nodes
VRML1.0 allowed content developers to create static 3D worlds which contained links to web content.
VRML2.0 builds on the geometric foundation of VRML 1.0 with additional nodes in geometry and the addition of three basic concepts:
  • sensors, scripts and, sound.

HTML version of Basic Foils prepared March 4 1998

Foil 34 Summary VRML2.0 Node Types - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
The node types are listed by category:
Grouping Nodes
Browser Information
Lights and Lighting
Sound
Shapes
There are also some Concepts deleted from VRML1
Geometry
Appearance
Geometric Sensors
Interpolation
Scripting Nodes

HTML version of Basic Foils prepared March 4 1998

Foil 35 Summary VRML2.0 Node Types - Grouping - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Grouping Nodes
Grouping Nodes include
Collision
  • Tells the browser whether or not given pieces of geometry can be navigated through.
Transform
  • Groups nodes together under a single coordinate system, or "frame of reference"; incorporates the fields of the VRML 1.0 Separator and Transform nodes.

HTML version of Basic Foils prepared March 4 1998

Foil 36 Summary Node Types - Browser Information - III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
In place of the old Info node type, VRML 2.0 provides several
  • new Browser Information node types to give specific information about the scene to the browser:
Background
  • Provides a shaded plane and/or distant geometry to be used as a backdrop, drawn behind the displayed scene.
NavigationInfo
  • Provides hints to the browser about what kind of viewer to use (walk, examiner, fly, etc.), suggested average speed of travel, a radius around the camera for use by collision detection, and an indication of whether the browser should turn on a headlight.

HTML version of Basic Foils prepared March 4 1998

Foil 37 Summary Node Types - Browser Information - IV

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Viewpoint
  • Specifies an interesting location in a local coordinate system from which a user might wish to view the scene. Replaces the former PerspectiveCamera node.
WorldInfo
  • Provides the scene's title and other information about the scene (such as author and copyright information), in a slightly more structured manner than a VRML 1.0 Info node.

HTML version of Basic Foils prepared March 4 1998

Foil 38 Summary Node Types - Sound/Light - V

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
New Lights and Lighting Nodes
Fog
  • Describes a variety of atmospheric effects such as fog, haze, and smoke.
Sound Nodes (None in VRML1.0)
Sound
  • Defines a sound source that emits sound primarily in a 3D space.
AudioClip
  • Specifies a source of audio to be used by other nodes and can be specified in source field of Sound node

HTML version of Basic Foils prepared March 4 1998

Foil 39 Summary Node Types - Shape/Geometry - VI

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Shapes
Shape
  • A node whose fields specify a set of geometry nodes and group these with a set of property (Appearance) nodes to apply to the geometry.
  • Replaces clumsy "binding" used for material and Texture Nodes in VRML1.0
Geometry
ElevationGrid
  • Provides a compact method of specifying an irregular "ground" surface.

HTML version of Basic Foils prepared March 4 1998

Foil 40 Summary Node Types - Geometry - VII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Geometry Nodes
Extrusion
  • A compact representation of extruded shapes and solids of rotation.
  • Allows richer set of basic 3D objects (VRML1.0 is only sphere, cylinder, box)
Text
  • Replaces VRML 1.0's AsciiText node; has many more options -- in particular to allow easy use of non-English text.

HTML version of Basic Foils prepared March 4 1998

Foil 41 Summary Node Types - Appearance/Properties - VII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Geometric Properties
Color
  • Defines a set of RGB colors to be used in the color fields of various geometry nodes.
Coordinate (was Coordinate3 in VRML1.0) Normal and TextureCoordinate are also in this category
New class of Appearance Nodes
Appearance
  • Gathers together all the appearance properties for a given Shape node. This is specified differently than in VRML1.0 and points to further nodes specifying Material, Texture and TextureTransform
  • Material, FontStyle, Image/Movie/Pixel Texture and TextureTransform are in this category

HTML version of Basic Foils prepared March 4 1998

Foil 42 Summary Node Types - Scripting - VIII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example of Scripting in VRML97 for Foil 42(Definition and Example)
Scripting Nodes
Script
  • Contains a program which can process incoming events and generating outgoing ones.
  • Currently Java and JavaScript allowed and this provides a more powerful approach to animation than simple interpolators

HTML version of Basic Foils prepared March 4 1998

Foil 43 Summary Node Types - Sensors - VIII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Sensor Nodes
These generate events when certain things happen -- typically corresponding to user actions or to certain timing constraints
ProximitySensor
  • Generates events when the camera moves within a bounding box of a specified size around a specified point.
TouchSensor
  • Generates events when the user moves the pointing device across an associated piece of geometry, and when the user clicks on said geometry.

HTML version of Basic Foils prepared March 4 1998

Foil 44 Summary Node Types - Sensors - IX

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
CylinderSensor
  • Generates events that interpret a user's click-and-drag on a virtual cylinder.
PlaneSensor
  • Generates events that interpret a user's click-and-drag as translation in two dimensions.

HTML version of Basic Foils prepared March 4 1998

Foil 45 Summary Node Types - Sensors - X

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
SphereSensor
  • Generates events that interpret a user's click-and-drag on a virtual sphere.
VisibilitySensor
  • Generates events as a regions enters and exits rendered view I.e. when user can see a certain part of scene
TimeSensor
  • Generates events at a given time or at given intervals of time.

HTML version of Basic Foils prepared March 4 1998

Foil 46 Summary Node Types - Interpolators - X

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index ColorInterpolator Example and Definition for Foil 46(Color Interpolator and Time sensor)
These are a critical set of nodes to generate animations with smooth movement with attributes moving through a linearly interpolated set of values
ColorInterpolator
  • Interpolates intermediate values from a given list of color values.
CoordinateInterpolator
  • Interpolates intermediate values from a given list of 3D vectors.

HTML version of Basic Foils prepared March 4 1998

Foil 47 Summary Node Types - Interpolators - XI

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index OrientationInterpolator Example and Definition for Foil 47(Example and Definition)
NormalInterpolator
  • Interpolates intermediate normalized vectors from a given list of 3D vectors.
OrientationInterpolator
  • Interpolates intermediate absolute rotations from a given list of rotation amounts.

HTML version of Basic Foils prepared March 4 1998

Foil 48 Summary Node Types - Interpolators - XII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index PositionInterpolator Example and Definition for Foil 48(Example and Definition)
PositionInterpolator
  • Interpolates intermediate values from a given list of 3D vectors, suitable for a series of translations.
ScalarInterpolator
  • Interpolates intermediate values from a given list of floating-point numbers.

HTML version of Basic Foils prepared March 4 1998

Foil 49 New Field Types - XIII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Field and Event Reference
In addition to other changes from VRML1, VRML 2.0 introduces a couple of new field types:
  • An SFInt32 field (formerly SFLong) contains a 32-bit integer. An MFInt32 field contains a list of 32-bit integers.
  • An SFNode field contains a node (or rather, a pointer to a node). An MFNode field contains a list of pointers to nodes.
  • An SFTime field contains a double-precision floating point value indicating a number of seconds since 00:00:00 Jan 1, 1970 GMT.
SFEnum (use SFString) and SFMatrix from VRML1.0 are deleted

HTML version of Basic Foils prepared March 4 1998

Foil 50 Deleted Node Types - XIII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
The following VRML 1.0 node types have been removed from VRML2.0:
  • AsciiText : replaced with Text
  • Info : replaced with WorldInfo
  • OrthographicCamera : shifted to browser User Interface responsibility (that is, browsers may provide an orthographic view of a world as an option)
  • PerspectiveCamera : replaced with Viewpoint.

HTML version of Basic Foils prepared March 4 1998

Foil 51 Deleted Node Types - XV

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Separator : use Transform instead
Transformation nodes : incorporated as fields of a Transform node (this was always possible in VRML1.0)
  • MatrixTransform
  • Transform
  • Translation
  • Rotation
  • Scale

HTML version of Basic Foils prepared March 4 1998

Foil 52 Summary of Sensors Interaction with the User

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML97 Time sensor Examples and Definitions of all Sensors for Foil 52(2 Time sewnsor examples and General Description)
Sensors provide mechanisms for the user to interact with objects in the world.
Functionally, they generate events based on time or on user action.
ProximitySensor
SphereSensor
TouchSensor
VisibilitySensor
CylinderSensor
TimeSensor
PlaneSensor

HTML version of Basic Foils prepared March 4 1998

Foil 53 Summary: Scripts and Interpolators - I Behavior and Animation

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Scripts and Interpolators are the way you breathe life into the VRML 2.0 world.
Interpolators are a built-in behavior mechanism that generate output based on linear interpolation of a number of key data points.
  • Use of these key data points to generate animating objects is called keyframe animation.
Scripts are used to create more intricate forms of behavior. Script nodes themselves contain source code or pointers to code for logic operations.

HTML version of Basic Foils prepared March 4 1998

Foil 54 Summary: Scripts and Interpolators - II Behavior and Animation

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Authors can feed data into a Script, have the script analyze the input and output an event to change the world.
Interpolators
  • color
  • coordinate
  • position
Script Languages
  • JavaScript
normal
orientation
scalar
Java

HTML version of Basic Foils prepared March 4 1998

Foil 55 Summary: Sound in VRML2.0

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Sound Example and Definition for Foil 55(Example and Definition)
3D Spatialized Audio for added realism and increased immersion. In the virtual world. Smart use of sound can have a significant impact on the user experience.
Keep in mind that VRML supports MIDI format for background sound tracks and that small .wav files can be triggered randomly by a script node to create ambient effects.

HTML version of Basic Foils prepared March 4 1998

Foil 56 Geometry Nodes Polygonal Description of the World

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Geometry Nodes
VRML 2.0 has new geometry nodes to enable more compact descriptions of complex virtual worlds. These nodes and use of the DEF/USE notation are crucial to making interesting worlds.
  • Billboard : align objects to an axis
  • ElevationGrid : create terrains
  • Extrusion : create objects by simply describing their outline
  • Text : now internationalized to enable multi-language support

HTML version of Basic Foils prepared March 4 1998

Foil 57 Shapes

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Shape Node
In VRML, the basic building blocks are shapes described by nodes and their accompanying fields and field values.
A shape has
  • geometry, that defines its 3-D structure,
  • appearance based on material, a color like red, from which it is made and its surface texture, like wood.
VRML supports several types of primitive shape geometries, such as box, cylinder, cone, sphere, extruded shape and elevation grid.

HTML version of Basic Foils prepared March 4 1998

Foil 58 Shape and Appearance Node Syntax

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Sample VRML2.0 File for Shapes and Groups
Shape node are built centered around the origin(0,0,0).
  • Shape { appearance NULL # exposedField SFNode geometry NULL # exposedField SFNode }
  • Appearance { material NULL # exposedField SFNode texture NULL # exposedField SFNode textureTransform NULL # exposedField SFNode }

HTML version of Basic Foils prepared March 4 1998

Foil 59 4 Primitive Geometries

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Geometry Nodes
Box { size 2.0 2.0 2.0 # defined a box }
Cone { bottomRadius 1.0 # field SFFloat height 2.0 # field SFFloat side TRUE # field SFBool bottom TRUE # field SFBool
}
Sphere {radius 1.0 # field SFFloat }
Cylinder { height 2.0 # field SFFloat
radius 1.5 # field SFFloat
}

HTML version of Basic Foils prepared March 4 1998

Foil 60 Shape Example - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Sample VRML2.0 File for Shapes and Groups
#VRML v2.0 utf8 Shape { appearance Appearance { material Material {} # use default } geometry Box {} # use default Box definition }
This VRML file creates a box in the screen.

HTML version of Basic Foils prepared March 4 1998

Foil 61 Shape Example - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Sample VRML2.0 File for Shapes and Groups
#VRML v2.0 utf8 Shape { appearance Appearance { material Material {} } geometry Box { size 1.0 3.0 5.0 } }
This VRML file creates a box in the screen but this time its width in the x-axis is 1, on the y-axis 3 and on the z-axis 5.

HTML version of Basic Foils prepared March 4 1998

Foil 62 Grouping Shapes -- Children

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Sample VRML2.0 File for Shapes and Groups
Shapes can be grouped together to construct larger, more complex shapes.
The node that groups together the group's shapes is called parent.
The shapes that make up the group are called the group's children.
A group can have any number of children.
Groups can even have other groups as children.(nested)
Group Nodes : Anchor, Billboard, Collision, Group, and Transform.
LOD Level of Detail is also a Grouping Node and has an extra level field compared to VRML1

HTML version of Basic Foils prepared March 4 1998

Foil 63 A Sample file for Shapes & Groups

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index 4 Sample Shapes on a Pedestal and Pedestal itself for Foil 63(See Inline of Pedestal)
[ prim.wrl ] Note Inline
of
pedestal.wrl
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/prim.wrl

HTML version of Basic Foils prepared March 4 1998

Foil 64 Group Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Group Node Definition
Group { children [
Shape { . . . },
Shape { . . . },
. . .
] # exposedField MFNode bboxCenter 0.0 0.0 0.0 # field SFVect3f bboxSize -1.0 -1.0 -1.0 # field SFVect3f addChildren # eventIn MFNode removeChildren # eventIn MFNode }

HTML version of Basic Foils prepared March 4 1998

Foil 65 Group Node Example

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
#VRML v2.0 utf8 Group { children [ Shape { appearance DEF White Appearance { material Material {} } geometry Box {size 1.0 3.0 5.0 } }, Shape { appearance USE White geometry Box {size 1.0 3.0 5.0} } ] }

HTML version of Basic Foils prepared March 4 1998

Foil 66 Billboard Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of Billboard Group
The Billboard is a group node.
The billboard coordinate system is automatically rotated so that the shapes in the group as a unit always turn to face the viewer, even as the viewer moves around the group. This effect is called as billboarding.
This can be used to define an advertisement billboard which always turn to face the viewer.
  • Billboard { addChildren # eventIn MFNode removeChildren # eventIn MFNode axisOfRotation 0 1 0 # exposedField SFVec3f children [] # exposedField MFNode bboxCenter 0 0 0 # field SFVec3f bboxSize -1 -1 -1 # field SFVec3f }

HTML version of Basic Foils prepared March 4 1998

Foil 67 A Sample Billboard Group

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of Billboard Group
[ robobill.wrl ]
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/robobill.wrl

HTML version of Basic Foils prepared March 4 1998

Foil 68 Events and Routes

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Events and Routes allow to make the VRML world dynamic such as clicking on a shape with a mouse can turn on a light, trigger a sound, or start up a machine.
To implement this, the events should be wired. One of them (eventOut) produces the event and the other one (eventIn) consumes it by implementing the necessary operation in the world.
Events are fields within the node. The sender and receiver nodes should has the same field type.
The connection between the node generating the event and the node receiving the event is called a Route.

HTML version of Basic Foils prepared March 4 1998

Foil 69 Execution Model for Event processing

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example of Execution Model for Foil 69(Definition and Example)
Once a sensor or Script has generated an initial event, the event is propagated from the eventOut producing the event along any ROUTEs to other nodes.
  • These other nodes may respond by generating additional events, continuing until all routes have been honored. This process is called an event cascade.
  • All events generated during a given event cascade are assigned the same timestamp as the initial event, since all are considered to happen instantaneously.
Some sensors generate multiple events simultaneously. In these cases, each event generated initiates a different event cascade with identical timestamps.

HTML version of Basic Foils prepared March 4 1998

Foil 70 Diagram of Execution Model for Event processing

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example of Execution Model for Foil 70(Definition and Example)

HTML version of Basic Foils prepared March 4 1998

Foil 71 ROUTE - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
ROUTE allows you to wire two nodes via events.
ROUTE NodeName.eventOutName_changed TO NodeName.set_eventInName
Routes may be established only from eventOuts to eventIns.
Routes are not nodes; ROUTE is merely a syntactic construct for establishing event paths between nodes.
Use DEF to give a Node a name!

HTML version of Basic Foils prepared March 4 1998

Foil 72 ROUTE - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
ROUTE statements may appear at either the top-level of a .wrl file or prototype implementation, or may appear inside a node wherever fields may appear.
The types of the eventIn and the eventOut must match exactly.
  • For example, it is illegal to route from an SFFloat to an SFInt32 or from an SFFloat to an MFFloat.

HTML version of Basic Foils prepared March 4 1998

Foil 73 Sensor Nodes - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Sensor Nodes Definition
Sensor nodes generate events.
Geometric sensor nodes (ProximitySensor, VisibilitySensor, TouchSensor, CylinderSensor, PlaneSensor, SphereSensor and the Collision group Node) generate events based on user actions, such as a mouse click(drag, over) or navigating close to a particular object.

HTML version of Basic Foils prepared March 4 1998

Foil 74 Sensor Nodes - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Time Sensor Definition and Examples for Foil 74(Definition and Examples)
TimeSensor nodes generate events as time passes.
Once a Sensor or Script has generated an initial event, the event is propagated along any ROUTE's to other nodes.
  • These other nodes may respond by generating additional events, and so on.
  • This process is called an event cascade. All events generated during a given event cascade are given the same timestamp as the initial event (they are all considered to happen instantaneously).

HTML version of Basic Foils prepared March 4 1998

Foil 75 Prototypes - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Prototype Definition and Examples for Foil 75(Definition and Examples)
Prototyping is a mechanism that allows the set of node types to be extended by the user from within a VRML file. It allows the encapsulation and parameterization of geometry, attributes, behaviors, or some combination thereof.
PROTO ProtoName
  • [ field SFBool foo # This is declaration section
  • eventOut SFColor foo2 # Names must be Unique
  • eventIn SFVec3f foo3
  • exposedField SFString foo4 # End declaration
  • ] {.. prototype definition ..}

HTML version of Basic Foils prepared March 4 1998

Foil 76 Prototypes - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Prototype Definition and Examples for Foil 76(Definition and Examples)
The prototype declaration contains:
  • a list of public eventIns and eventOuts that can send and receive events
  • a list of public exposedFields and fields, with default values
The prototype definition contains a list of one or more nodes, and zero or more routes and prototypes.
The first node in definition is used to define node type
  • e.g. if first node is sphere, then this prototype can be used wehenever a sphere node could
Following nodes can be used in routes and scripts but are NOT rendered
  • rendering based on declaration
The nodes in this declaration list may also contain the IS syntax associates field and event names contained within the prototype definition with the events and fields names in the prototype declaration.

HTML version of Basic Foils prepared March 4 1998

Foil 77 Prototype Sample

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Prototype Definition and Examples for Foil 77(Definition and Examples)
[ prototype.wrl ]
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/prototype.wrl

HTML version of Basic Foils prepared March 4 1998

Foil 78 IS Statement

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Examples of IS/Prototypes for Foil 78(Definition and Examples)
Each eventIn in the prototype declaration is associated with an eventIn or exposedField defined in the prototype's node definition via the IS syntax.
PROTO FooTransform
[ eventIn SFVec3f set_position ]
{
Transform { set_translation IS set_position }
}
This definition exposes a Transform node's set_translation event by giving it a new name (set_position) in the prototype interface.

HTML version of Basic Foils prepared March 4 1998

Foil 79 Transform Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Transform Node Definition(Definition)
The Transform node allows you to position shapes and groups of shapes anywhere in your world by using its translation field. Every transform node defines a new coordinate system within its parent's coordinate system.
  • Transform { children [] # exposedField MFNode translation 0.0 0.0 0.0 # exposedField SFVec3f rotation 0.0 0.0 0.0 0.0 # exposedField SFRotation scale 1.0 1.0 1.0 # exposedField SFVec3f scaleOrientation 0.0 0.0 1.0 0.0 # exposedField SFRotation bboxCenter 0.0 0.0 0.0 # field SFVec3f bboxSize -1.0 -1.0 -1.0 # field SFVect3f center 0.0 0.0 0.0 # field SFVec3f addChildren # eventIn MFNode removeChildren # eventOut MFNode }

HTML version of Basic Foils prepared March 4 1998

Foil 80 Transform Node Example

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Simple Example also used for Shapes from www.vrml.org site(Old Simple Example)
#VRML v2.0 utf8 Transform { translation 0.0 2.0 0.0 children [ Shape { appearance Appearance { material Material {} } geometry Cylinder {} ] }
Creates a Cylinder and puts its origin at (0.0,2.0,0.0)

HTML version of Basic Foils prepared March 4 1998

Foil 81 Rotation Field in Transform - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Transform Definition and Rotation Example for Foil 81(Definition and Example)
rotation field of the Transform node provide the rotation operation.
First three values defines the rotation axis which is an imaginary line about which a coordinate system is rotated.
  • To define an axis it is necessary to specify the two end points in the 3D coordinate system.
  • The First point comes from the center field of the Transform node and the other end point's coordinate values come from the rotation field.

HTML version of Basic Foils prepared March 4 1998

Foil 82 Rotation Field - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Transform Definition and Rotation Example for Foil 82(Definition and Example)
For example to rotate along the X-axis use 1.0 0.0 0.0,
  • or up along the Y axis use 0.0 1.0 0.0,
  • and out along the Z-axis use 0.0 0.0 1.0
(Assuming that center is 0.0 0.0 0.0) this defines the rotation axis.
The last value in the rotation field specifies the rotation angle in terms of radians.
The rotation center can be specified by changing the center field of the Transform node.

HTML version of Basic Foils prepared March 4 1998

Foil 83 Rotation Example - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Transform Definition and Rotation Example for Foil 83(Definition and Example)
#VRML V2.0 utf8
Group {
children [
DEF Arm1 Shape { # Arm1
appearance Appearance {
material Material { }
}
geometry Cylinder {
height 1.0
radius 0.1
} },
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/rotation.wrl
[ rotation.wrl ]

HTML version of Basic Foils prepared March 4 1998

Foil 84 Rotation Example - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Transform Definition and Rotation Example for Foil 84(Definition and Example)
Transform { # Arm2
rotation 1.0 0.0 0.0 1.047
children USE Arm1
},
Transform { # Arm3
rotation 1.0 0.0 0.0 2.094
children USE Arm1
}
]
}

HTML version of Basic Foils prepared March 4 1998

Foil 85 Scale Field in Transform

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of Scale(A tree scaled along a diagonal axis using scale orientation)
scale and scaleOrientation field of the Transform node allows to scale shapes and groups of shapes to any size.
scale field has three values and each of them defines the appropriate scale factor on the corresponding axis.This allows to warp the shapes.
scaleOrientation field allows to specify an orientation for the scaling. When it is specified, before the scaling operation the coornidate system is rotated and after the scale operation the coordinate system will be rotated back so that coordinate system remains unchanged. This orientation change enables to scale shapes diagonally instead of just horizontally, vertically, and front to back.

HTML version of Basic Foils prepared March 4 1998

Foil 86 Scale Example - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of Scale(A tree scaled along a diagonal axis using scale orientation)
#VRML V2.0 utf8
children [
# Ground
Shape {
appearance DEF White
Appearance {
material Material { }
}
geometry Box {
size 12.0 0.1 12.0
}
},
# A tree scaled along a diagonal axis using scale orientation.
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/scaledtree.wrl

HTML version of Basic Foils prepared March 4 1998

Foil 87 Scale Example - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of Scale(A tree scaled along a diagonal axis using scale orientation)
Transform { # Tree
translation 0.0 1.0 0.0
scale 1.0 2.0 1.0
scaleOrientation 0.0 0.0 1.0 -0.785
center 0.0 -1.0 0.0
children [ # Trunk
Shape { appearance USE White
geometry Cylinder { radius 0.5
height 2.0
}
},

HTML version of Basic Foils prepared March 4 1998

Foil 88 Scale Example - III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of Scale(A tree scaled along a diagonal axis using scale orientation)
Transform { # Branches
translation 0.0 3.0 0.0
children Shape { appearance USE White
geometry Cone { bottomRadius 2.0
height 4.0
}
}
}
]
}
]
}

HTML version of Basic Foils prepared March 4 1998

Foil 89 Material Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2 Material Definition and Examples for Foil 89(Definition and Examples)
It is possible to define the appearance of each shape by specifying the atributes of the material. Appearance and Material nodes allows to define this appearance.
  • Material { diffuseColor 0.8 0.8 0.8 # exposedField SFColor emissiveColor 0.0 0.0 0.0 # exposedField SFColor transparency 0.0 # exposedField SFFloat ambientIntensity 0.2 # exposedField SFFloat specularColor 0.0 0.0 0.0 # exposedField SFColor shininess 0.2 # exposedField SFFloat }

HTML version of Basic Foils prepared March 4 1998

Foil 90 Material Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2 Material Definition and Examples for Foil 90(Definition and Examples)
VRML simplifies the simulation of real world lighting by ignoring reflections and assuming light comes either from a specific source or is "ambient". The latter is the sum of all complex lighting!
  • This approximation is motivated by need to render in a reasonable time!
In the real world when light ray strike a surface, some is absorbed by it, some is reflected off it, and some is transmitted through the surface.
The light that reflects or is transmitted through a surface continuous into the world, bouncing from surface to surface to illimunate the scene.
To simplify the complex lighting operations, VRML uses a simplified methods. It supports two types of reflection: diffuse reflection and specular reflection.

HTML version of Basic Foils prepared March 4 1998

Foil 91 Material Node - III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2 Material Definition and Examples for Foil 91(Definition and Examples)
transparency specifies the amount of tranparency as a factor between 0.0 and 1.0. A value 0.0 indicates that the corresponding shape is opaque and a value 1.0 indicates that the shape is completely transparent.
Diffuse reflection bounces light off a surface in random directions. Since rays bounces in a random directions, there will be a gentle and diffuse light on a shape without any glints, sparkles and highlights.
diffuseColor controls the RGB color of the light reflected by diffuse reflection.

HTML version of Basic Foils prepared March 4 1998

Foil 92 Material Node - IV

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2 Material Definition and Examples for Foil 92(Definition and Examples)
specularColor field specifies the color of a specular reflection highlight on the surface used when light rays are not bent through large angles.
Specular reflection bounces light off a surface in a mathematically predictable way that makes shiny surface reflect the world around them.
shininess specifies the shininess of the material.
  • A value of 0.0 makes shapes dull and matte.
  • Higher values make them appear more shiny.

HTML version of Basic Foils prepared March 4 1998

Foil 93 Material Node - V

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2 Material Definition and Examples for Foil 93(Definition and Examples)
Ambient light is a light that has bounced from surface to surface many times and provides a general, overall illumination for a room.
ambientIntensity specifies how shape respond to ambient light. This value varies between 0 and 1. The higher the ambient intensity of shape is, the more sensitive to ambient light the shape is.
emissiveColor specifies the glow as an RGB color. Brighter emissive colors make shapes appear to emit more light so that they glow more brightly.
  • The default value is no glow(black).
  • Note that glowing shapes can not light up shapes around them since they are not light source.

HTML version of Basic Foils prepared March 4 1998

Foil 94 A Sample World Using Appearance -Material

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2 Material Definition and Examples for Foil 94(Definition and Examples)
[ slabs.wrl ]
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/slabs.wrl

HTML version of Basic Foils prepared March 4 1998

Foil 95 Animation - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Spacial Sound w/ Touch Sensor, & Keyframe Animation(Spacial Sound w/ Touch Sensor, & Keyframe Animation)
Animation is the change of something as time progress such as change in position, scale, orientation, etc..
Any animation needs two elements:
  • A clock to control the playback of the animation
  • A description of how something changes during the course of the animation.

HTML version of Basic Foils prepared March 4 1998

Foil 96 Animation - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Example and Definition of Interpolaters for Foil 96(Example and Definition)
An animation which is independent of the exact date and time at which it is played back can be described by fractional time.
  • In this technique, it is assumed that an animation starts at fractional time 0.0 and ends at fractional time 1.0.
Animation descriptions use a technique called keyframe animation where a position or rotation is specified for only a few key fractional times.
  • The position or rotation values at these times are called key values.
  • Using keyframe animation, an animation description specifies only a few positions or rotations, instead of an infinite number of them.

HTML version of Basic Foils prepared March 4 1998

Foil 97 PositionInterpolator - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Examples of Position Interpolatoers for Foil 97(Definition and examples of Pendulum and Shuttle)
A PositionInterpolator node allow to define a list of key fractional times and key values to describe an animation.
Key fractional times are listed as values in an interpolator node's key field, while key values are listed in the node's keyValue field.
  • PositionInterpolator { set_fraction # eventIn SFFloat key [] # exposedField MFFloat keyValue [] # exposedField MFVec3f value_changed # eventOut SFVec3f }

HTML version of Basic Foils prepared March 4 1998

Foil 98 PositionInterpolator - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
A simple animation can be implemented by the following routings. The fraction_changed eventOut of a TimeSensor node can be wired to a set_fraction eventIn of interpolator.
Whenever interpolator receives a set_fraction event, it computes a new position value (according to keyValues) and places it in a value_changed eventOut.
By wiring this eventOut which holds a 3-vector to the Transform node's appropriate eventIn attribute, the animation can be implemented.

HTML version of Basic Foils prepared March 4 1998

Foil 99 An Example Using PositionInterpolators

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of PositionInterpolator and Inline
[ doorway.wrl ]
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/doorway.wrl

HTML version of Basic Foils prepared March 4 1998

Foil 100 In Header of doorway.wrl -- What it does

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of PositionInterpolator and Inline
A ProximitySensor routes to four TimeSensors, one per sliding stair. (see later for these nodes)
Each stair's timer routes to a PositionInterpolator that outputs varying positions side-to-side along the X axis.
The PositionInterpolator's positions are routed into translation fields for Transform nodes surrounding each stair.
By using different starting positions, the four stairs are made to slide back and forth in a pattern.

HTML version of Basic Foils prepared March 4 1998

Foil 101 The First Stair in doorway.wrl

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of PositionInterpolator and Inline
DEF Stair1 Transform { # Label each stair
translation 0.0 0.0 0.0 # Will change
# this translation's value
children [ # name Stair so can re-use
DEF Stair Inline {
url "tread.wrl" # This wrl holds
}, # details of stairs
]
},

HTML version of Basic Foils prepared March 4 1998

Foil 102 Animation Strategy in doorway.wrl

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of PositionInterpolator and Inline
For each stair, a TimeSensor (Stair1Timer on next foil) is triggered by a world ProximitySensor. (set when you enter bounding box)
Once triggered, the time sensor outputs fractions forever.
The fractions are routed in to PositionInterpolators (Stair1Path) that smoothly interpolate a sliding position back and forth along the X axis.
These positions are routed in to translations (Stair1.set_translation) for the individual stairs.

HTML version of Basic Foils prepared March 4 1998

Foil 103 Animation Code for Stair1 in doorway.wrl

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of PositionInterpolator and Inline
DEF Stair1Timer TimeSensor {
cycleInterval 4.0
loop TRUE
}
DEF Stair1Path PositionInterpolator {
key [ 0.0, 0.25, 0.5, 0.75, 1.0 ]
keyValue [ 0.0 0.0 0.0, 3.0 0.0 0.0, 0.0 0.0 0.0, -3.0 0.0 0.0, 0.0 0.0 0.0 ]
}
ROUTE Proximity.enterTime TO Stair1Timer.set_startTime
ROUTE Stair1Timer.fraction_changed TO Stair1Path.set_fraction
ROUTE Stair1Path.value_changed TO Stair1.set_translation

HTML version of Basic Foils prepared March 4 1998

Foil 104 OrientationInterpolator

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index OrientationInterpolator Example and Definition for Foil 104(Example and Definition)
The PositionInterpolator and OrientationInterpolator nodes both use linear interpolation to compute intermediate values between the given key values.
  • OrientationInterpolator { set_fraction # eventIn SFFloat key [] # exposedField MFFloat keyValue [] # exposedField MFRotation value_changed # eventOut SFRotation }
  • Interpolates a rotation specified as usual by axis and angle
  • The number of keyvalues must be equal to number of keys

HTML version of Basic Foils prepared March 4 1998

Foil 105 ColorInterpolator

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index ColorInterpolator Example and Definition for Foil 105(Example and Definition)
ColorInterpolator { set_fraction # eventIn SFFloat key [] # exposedField MFFloat keyValue [] # exposedField MFColor value_changed # eventOut SFColor }
# Interpolates a RGB color field
# The number of keyvalues must be equal to number of keys

HTML version of Basic Foils prepared March 4 1998

Foil 106 ScalarInterpolator

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 ScalarInterpolator Node
ScalarInterpolator { set_fraction # eventIn SFFloat key [] # exposedField MFFloat keyValue [] # exposedField MFFloat value_changed # eventOut SFFloat }
# Interpolates a single floating point number
# The number of keyvalues must be equal to number of keys

HTML version of Basic Foils prepared March 4 1998

Foil 107 NormalInterpolator Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 NormalInterpolator Node
NormalInterpolator node can be used to animate normal vectors in a Normal node which contains sets of normals used in IndexedFaceSet and ElevationGrid.
  • NormalInterpolator {
  • set_fraction # eventIn SFFloat
  • key [] # exposedField MFFloat
  • keyValue [] # exposedField MFVec3f
  • value_changed # eventOut MFVec3f
  • }
The number of keyvalues must be a multiple of number of keys
The Normal Interpolation is performed along arcs joining keyValues on surface of a sphere

HTML version of Basic Foils prepared March 4 1998

Foil 108 Handling User Interactions - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
A sensor node senses the user actions with a pointing device, such as mouse.
There are two different pointing device types: 2-D pointing devices and 3-D pointing devices.
  • Mouse, trackball, trackpad and joystick belong to the first class.
  • A data glove and a CAVE wand belong to the second class.

HTML version of Basic Foils prepared March 4 1998

Foil 109 Handling User Interactions - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Browser observes three types of action from the pointing device
  • Move : without pressing a mouse button, move the cursor over an item
  • Click : while the cursor is over an item, press a mouse button, then immediately release the button without moving the mouse.
  • Drag : while the cursor is over an item, press a mouse button, move the mouse, then release the button.

HTML version of Basic Foils prepared March 4 1998

Foil 110 TimeSensor - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index TimeSensor Examples and Definition for Foil 110(Example and Definition)
A TimeSensor node can create a clock tick. It can be started or stopped at a specific date and time by providing absolute times for the node's startTime and stopTime fields.
  • TimeSensor { cycleInterval 1 # exposedField SFTime enabled TRUE # exposedField SFBool loop FALSE # exposedField SFBool startTime 0 # exposedField SFTime stopTime 0 # exposedField SFTime cycleTime # eventOut SFTime fraction_changed # eventOut SFFloat isActive # eventOut SFBool time # eventOut SFTime
  • }

HTML version of Basic Foils prepared March 4 1998

Foil 111 TimeSensor - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Elevation Grid, Color Interpolation, Billboard, and Movie Texture(Elevation Grid, Color Interpolation, Billboard, and Movie Texture)
isActive field shows whether TimeSensor node is active or not.
It outputs fractional times on its fraction_changed eventOut.
The length of time between fractional time 0.0 and 1.0 can be specified by cycleInterval field.
Repetition of the same animation continuously can be requested by setting loop field of node.
When the loop is running, cycleTime outputs the time at which each new cycle starts over so that this eventOut might allow to synchronize several animations in the world.

HTML version of Basic Foils prepared March 4 1998

Foil 112 TouchSensor - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Examples and Definition of TouchSensor for Foil 112(Examples and Definition)
A TouchSensor node can be added to any group. It senses Click and Move actions. When the viewer's cursor moves over the sensed group ( a VRML group containing a sensor node) of shapes, isOver eventOut of TouchSensor produces output as a TRUE. As long as, a cursor is over the group of shape, it stays at TRUE level.
When the viewer produces click action, isActive eventOut of TouchSensor produces TRUE and it will produce FALSE as soon as click action ends.

HTML version of Basic Foils prepared March 4 1998

Foil 113 TouchSensor - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Examples and Definition of TouchSensor for Foil 113(Examples and Definition)
TouchSensor { enabled TRUE # exposedField SFBool hitNormal_changed # eventOut SFVec3f hitPoint_changed # eventOut SFVec3f hitTexCoord_changed # eventOut SFVec2f isActive # eventOut SFBool isOver # eventOut SFBool touchTime # eventOut SFTime }

HTML version of Basic Foils prepared March 4 1998

Foil 114 PlaneSensor

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and 2 Examples of a PlaneSensor for Foil 114(Definition and Examples)
The PlaneSensor node senses viewer drag actions, computes the translation distances and outputs these using its translation_changed eventOut.
By wiring translation_changed eventOut of PlaneSensor to the set_translation eventIn of Transform node, it is possible to let viewer drag a shape in the world.
  • PlaneSensor { autoOffset TRUE # exposedField SFBool enabled TRUE # exposedField SFBool maxPosition -1 -1 # exposedField SFVec2f minPosition 0 0 # exposedField SFVec2f offset 0 0 0 # exposedField SFVec3f isActive # eventOut SFBool trackPoint_changed # eventOut SFVec3f translation_changed # eventOut SFVec3f
    • }

HTML version of Basic Foils prepared March 4 1998

Foil 115 SphereSensor

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and 2 Examples of a SphereSensor for Foil 115(Definition and Examples)
The SphereSensor node senses viewer drag actions, computes rotation axis and angles, and output these using rotation_changed eventOut.
By wiring rotation_changed eventOut of SphereSensor to the set_rotation eventIn of Transform node, it is possible to let viewer rotate the shape in any direction in the world.
  • SphereSensor { autoOffset TRUE # exposedField SFBool enabled TRUE # exposedField SFBool offset 0 1 0 0 # exposedField SFRotation isActive # eventOut SFBool rotation_changed # eventOut SFRotation trackPoint_changed # eventOut SFVec3f }

HTML version of Basic Foils prepared March 4 1998

Foil 116 CylinderSensor

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and 2 Examples of a CylinderSensor for Foil 116(Definition and Examples)
The CylinderSensor node senses viewer drag actions, computes rotation axis and angles, and output these using rotation_changed eventOut.
By using this sensor, it is possible to define a shape, like disk, than can be turned via draging the mouse.
  • CylinderSensor { autoOffset TRUE # exposedField SFBool diskAngle 0.262 # exposedField SFFloat enabled TRUE # exposedField SFBool maxAngle -1 # exposedField SFFloat minAngle 0 # exposedField SFFloat offset 0 # exposedField SFFloat isActive # eventOut SFBool rotation_changed # eventOut SFRotation trackPoint_changed # eventOut SFVec3f }

HTML version of Basic Foils prepared March 4 1998

Foil 117 VisibilitySensor Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VisibilitySensor Definitions for Foil 117(Definitions Only)
Visibility sensors sense whether a box-shaped region in the VRML world is visible from the viewer's position and orientation so that it is possible to control the animation or actions that are only necessary when a sensed region can be seen.
  • VisibilitySensor {
  • center 0 0 0 # exposedField SFVec3f
  • enabled TRUE # exposedField SFBool
  • size 0 0 0 # exposedField SFVec3f
  • enterTime # eventOut SFTime
  • exitTime # eventOut SFTime
  • isActive # eventOut SFBool
  • }

HTML version of Basic Foils prepared March 4 1998

Foil 118 VisibilitySensor Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VisibilitySensor Definitions for Foil 118(Definitions Only)
center specifies the 3-D coordinate at the center of a sensed region.
size field defines the dimensions of a sensor's box-shaped region a width, a height, and a depth measured along the X, Y, and Z axes of the current coordinate system.
isActive eventOut flags whether any part of sensed region is consrained within the viewing-volume frustrum.
enabled field enables and disables the VisibilitySensor.
enterTime event is generated whenever the isActive TRUE event is generated.
exitTime events are generated whenever isActive FALSE events are generated.

HTML version of Basic Foils prepared March 4 1998

Foil 119 ProximitySensor Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and 2 Examples ProximitySensor for Foil 119(Definition and Examples)
Proximity sensors sense when a viewer enters and moves about within a box-shaped region in the VRML world.
  • ProximitySensor {
  • center 0 0 0 # exposedField SFVec3f
  • size 0 0 0 # exposedField SFVec3f
  • enabled TRUE # exposedField SFBool
  • isActive # eventOut SFBool
  • position_changed # eventOut SFVec3f
  • orientation_changed # eventOut SFRotation
  • enterTime # eventOut SFTime
  • exitTime # eventOut SFTime
  • }

HTML version of Basic Foils prepared March 4 1998

Foil 120 ProximitySensor Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and 2 Examples ProximitySensor for Foil 120(Definition and Examples)
center, size, enabled, isActive, enterTime and exitTime fields have the same definition we gave in the VisibilitySensor.
position_changed and orientation_changed events occurs whenever the position and orientation of the viewer changes with respect to the ProximitySensor's coordinate system.

HTML version of Basic Foils prepared March 4 1998

Foil 121 Collision Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example Collision Node for Foil 121(Definition and Example)
All objects in the scene are collidable. The browser detects geometric collisions between the user's avatar (see NavigationInfo) and the scene's geometry, and prevent the avatar from entering the geometry.
Collision detection detects when the user comes close to and collides with the shapes in the VRML world.
  • Collision {
  • addChildren # eventIn MFNode
  • removeChildren # eventIn MFNode
  • children [] # exposedField MFNode
  • collide TRUE # exposedField SFBool
  • bboxCenter 0 0 0 # field SFVec3f
  • bboxSize -1 -1 -1 # field SFVec3f
  • proxy NULL # field SFNode
  • collideTime # eventOut SFTime
  • }

HTML version of Basic Foils prepared March 4 1998

Foil 122 Collision Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example Collision Node for Foil 122(Definition and Example)
collide field enables and disables collision detection.
The collideTime eventOut generates an event specifying the time when the user's avatar (see NavigationInfo) intersects the collidable children or proxy of the Collision node.
proxy is a legal child node that is used as a substitute for the Collision's children during collision detection
  • The proxy is NOT drawn
bboxCenter and bboxSize fields specify a bounding box that encloses the Collision's children.

HTML version of Basic Foils prepared March 4 1998

Foil 123 Treatment of Multiple Sensors

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
When multiple sensor nodes are siblings in the same group, they all simultaneously sense viewer actions on the same group of shapes.
For instance, it is possible to use a TouchSensor node to detect when the viewer's cursor has moved over a shape, and a PlaneSensor node to enable the viewer to drag the shape around.
When multiple sensors are in different groups, and those groups are nested within each other, then the sensor that is in the innermost nested group overrides those in outer groups.

HTML version of Basic Foils prepared March 4 1998

Foil 124 Inline Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of Inline:Dinette and Components as well as Pyramid for Foil 124
Inlining enables to build each of the shapes for the world in a separate VRML file so that we can independently build the smaller parts of the world and combine them without putting everything into one file. Inline node provide this service.
url field defines a list of URL addresses and browser go through these URL addresses until it finds something to open or it reaches end of list.
  • Inline { url [] # exposedField MFString bboxCenter 0 0 0 # field SFVec3f bboxSize -1 - 1 -1 # field SFVec3f }

HTML version of Basic Foils prepared March 4 1998

Foil 125 A Sample Inlined File

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of Inline:Dinette and Components as well as Pyramid for Foil 125
[ chair.wrl ]
[ table.wrl ]
[ dinette.wrl ]
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/dinette.wrl
Make up using Inline the

HTML version of Basic Foils prepared March 4 1998

Foil 126 Linking Different VRML Worlds

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML97 Examples and Definition of Anchor for Foil 126(Examples and Definition)
Anchor grouping node provides this service so that it is possible to connect a door in the VRML world to a destination VRML world described elsewhere on Web.
The node's url field specifies the URL address of the corresponding VRML Web page to which the viewer travels when the viewer clicks on the anchor shape.
  • Anchor {
    • addChildren # eventIn MFNode
    • removeChildren # eventIn MFNode
    • children [] # exposedField MFNode
    • description "" # exposedField MFString
    • parameter [] # exposedField MFString
    • url [] # exposedField MFString
    • bboxCenter 0 0 0 # field SFVec3f
    • bboxSize -1 -1 -1 # field SFVec3f
  • }

HTML version of Basic Foils prepared March 4 1998

Foil 127 An Example of Anchor Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML97 Examples and Definition of Anchor for Foil 127(Examples and Definition)
[ stairway.wrl ]
[ Anchor.wrl ]
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/anchor.wrl

HTML version of Basic Foils prepared March 4 1998

Foil 128 Text Node Definition

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example of Text Node for Foil 128(Definition and Example)
Text Shapes build 2D text in a VRML world
  • Use for Signs, notes, annotation, control panels
Shape { geometry
  • Text { string [] # exposedField MFString
  • fontStyle NULL # exposedField SFNode
  • length [] # exposedField MFFloat
  • maxExtent 0.0 # exposedField SFFloat
  • }
}
Text strings list the text to build in string field
Each entry in string vector generates a single line or column (depending on fontstyle field horizontal field value)
  • Text { string [ "CPS616", "Instructor : G. FOX" ] }
Note Text is viewed as being in "geometry" class

HTML version of Basic Foils prepared March 4 1998

Foil 129 Text Node Notes

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example of Text Node for Foil 129(Definition and Example)
The Text node builds flat (not 3D !) text characters in X-Y plane with a Z axis depth of 0.0.
length field specifies the desired length, in VRML units, of each line of text. To match the specified length, lines or columns of text are composed or expanded by changing their character size or character spacing. length=0 implies no length constraint
maxExtent field specifies the maximum permissible length, in VRML units, of any line or column of text.
  • Lines or columns longer than the maxExtent are compressed but the lines or columns of text shorter than maxExtent remains the same.
fontStyle field specifies the characteristics defining the look and alignment of text created by the Text node.

HTML version of Basic Foils prepared March 4 1998

Foil 130 Font Style Node Definition - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example of FontStyle for Foil 130(Definition and Example)
FontStyle {
family "SERIF" # field SFString
horizontal TRUE # field SFBool
justify "BEGIN" # field MFString
language "" # field SFString
leftToRight TRUE # field SFBool
size 1.0 # field SFFloat
spacing 1.0 # field SFFloat
style "PLAIN" # field SFString
topToBottom TRUE # field SFBool
}
style field specifies the text style to use such as PLAIN, BOLD, ITALIC, and BOLDITALIC.

HTML version of Basic Foils prepared March 4 1998

Foil 131 Font Style Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example of FontStyle for Foil 131(Definition and Example)
family field indicates which of the standart VRML font families to use such as SERIF, SANS, and TYPEWRITER.
size field specifies the height of the characters measured in VRML units.
spacing field specifies the vertical line spacing, in VRML units, of horizontal text or horizontal column spacing of vertical text.

HTML version of Basic Foils prepared March 4 1998

Foil 132 Font Style Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example of FontStyle for Foil 132(Definition and Example)
horizontal field specifies whether text strings are built horizontally (rows) or vertically (columns).
justify field determines alignment of the above text layout relative to the origin of the object coordinate system. The possible values for each enumerant of the justify field are "FIRST", "BEGIN", "MIDDLE", and "END".
language field specifies the context of the language for the text string.

HTML version of Basic Foils prepared March 4 1998

Foil 133 Lights - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Collison, AudioClip, PointLight, Texture map, and Background(Collison, AudioClip, PointLight, Texture map, and Background)
Lights in a VRML world serve the same purpose as lights in real world. VRML provides three node types to control lighting: PointLight, DirectionalLight, and SpotLight.
A light can be placed anywhere in the VRML world but a viewer cannot see any kind of geometrical indication related to that light. A viewer can of course see the effect of that light in the VRML world.
Note lights only affect a Shape which has a non NULL Appearance node and a non NULL Material node within Appearance node
ambientIntensity reflects general affect of reflections as an approximation to exact rendering

HTML version of Basic Foils prepared March 4 1998

Foil 134 Lights - Pointlight Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example PointLight for Foil 134(Definition and Example)
A PointLight is a light located in a VRML world that emanates light in a radial pattern in all directions, as if the light was all coming from a single point.
  • PointLight {
  • ambientIntensity 0 # exposedField SFFloat
  • attenuation 1 0 0 # exposedField SFVec3f
  • color 1 1 1 # exposedField SFColor
  • intensity 1 # exposedField SFFloat
  • location 0 0 0 # exposedField SFVec3f
  • on TRUE # exposedField SFBool
  • radius 100 # exposedField SFFloat
  • }

HTML version of Basic Foils prepared March 4 1998

Foil 135 PointLight Node Fields - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example PointLight for Foil 135(Definition and Example)
location specifies the 3-D coordinate of the light.
radius defines the maximum reach of light. A shape that is far away from the light will not show the effect of this light.
intensity controls the brightness of the light source. It can have value between 0 and 1. To turn off the light, set its intensity to zero.
ambientIntensity field controls the effect of the light source has on the ambient-light level for shapes within the light's radius.

HTML version of Basic Foils prepared March 4 1998

Foil 136 PointLight Node Fields - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example PointLight for Foil 136(Definition and Example)
color specifies a RGB color for the light.
attenuation field controls how the light source's brightness fades as one moves away from center (position of PointLight) of sphere of influence. For a shape coordinate within this sphere at a distance d from the light's location, the light color brightness at that shape coordinate is determined as follows:
  • attenuatedColor = lightColor/(attenuation[0]+attenuation[1]*d+attenuation[2]*d*d)
  • attenuation[0] controls whether light has a constant brightness within the sphere of illumination.
  • attenuation[1] controls how the light brightness drops off with distance from the light.
  • attenuation[2] controls how the light brightness drops off with the square of distance from the light. (Normal laws of physics)

HTML version of Basic Foils prepared March 4 1998

Foil 137 DirectionalLight Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and Example of DirectionalLight for Foil 137(Definition and Example)
A DirectionalLight is a light aimed at the world from infinitely far away so that all of its light rays are parallel and point in the same direction
  • DirectionalLight {
  • ambientIntensity 0 # exposedField SFFloat
  • color 1 1 1 # exposedField SFColor
  • direction 0 0 -1 # exposedField SFVec3f
  • intensity 1 # exposedField SFFloat
  • on TRUE # exposedField SFBool
  • }
direction field defines a 3-D vector which indicates the direction for the light rays.

HTML version of Basic Foils prepared March 4 1998

Foil 138 SpotLight Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 SpotLight Node
A SpotLight is a light placed at a location in the VRML world, centered in a specific direction, and constrained so that its rays emanate within a light cone. Shapes that fall in within cone of light are illuminated by the spotlight, and others are not.
  • SpotLight {
  • ambientIntensity 0 # exposedField SFFloat
  • attenuation 1 0 0 # exposedField SFVec3f
  • beamWidth 1.570796 # exposedField SFFloat
  • color 1 1 1 # exposedField SFColor
  • cutOffAngle 0.785398 # exposedField SFFloat
  • direction 0 0 -1 # exposedField SFVec3f
  • intensity 1 # exposedField SFFloat
  • location 0 0 0 # exposedField SFVec3f
  • on TRUE # exposedField SFBool
  • radius 100 # exposedField SFFloat
  • }

HTML version of Basic Foils prepared March 4 1998

Foil 139 SpotLight Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 SpotLight Node
cutOffAngle field specifies the spread angle of a cone of illumination whose tip is at the spotlight's location and whose cone axis is aligned parallel with the spotlight's aim direction. Increasing the cutOffAngle field's value widens the spread of the cone, while decreasing the angle narrows the cone of illumination.
beamWidth field specifies an inner solid angle in which the light source emits light at uniform full intensity. If beamWidth > cutOffAngle, then beamWidth is assumed to be equal to cutOffAngle and the light source emits full intensity within the entire solid angle defined by cutOffAngle.
Both beamWidth and cutOffAngle must be greater than 0.0 and less than or equal to PI/2 radians.

HTML version of Basic Foils prepared March 4 1998

Foil 140 Defining VRML shapes with points, lines, and faces

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
A VRML point is a dot located within a VRML world. To locate the exact location of a point, it is necessary to give the coordinate of that point. Coordinate node allow to define 3-D coordinates:
  • Coordinate { point [] # exposedField MFVec3f }
Coordinate node can be used any coord field of PointSet, IndexedLineSet, or IndexedFaceSet node.
Each value of point field contains three floating-point number.
The first value in the point array is indexed as 0th component.
set_point and point_changed events are implied because of exposedField definition. These allow one to move/animate points

HTML version of Basic Foils prepared March 4 1998

Foil 141 PointSet Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Example and Definition of PointSet in VRML97 for Foil 141(Example and Definition)
A PointSet is a collection of points and their colors. PointSet node allows one to define this matchup with:
  • PointSet { coord NULL # exposedField SFNode color NULL # exposedField SFNode }
coord field of the node holds the coordinate of points specified with a Coordinate node.
color field of node holds the color of each point. Color node should be used to define these colors.
  • Color node creates a list of colors and may be used as the color field of coordinate based geometry nodes (PointSet, IndexedLineSet, IndexedFaceSet, ElevationGrid).

HTML version of Basic Foils prepared March 4 1998

Foil 142 Binding Colors to points, lines, and faces

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index IndexedLineSet Definition
A VRML line is a straight line connecting to end points, each one located in the world.
VRML allows to define a polyline which has a starting coordinate, several intermediate coordinates, and an ending coordinate. The VRML browser draws a straight line from the strarting coordinate to the first intermediate coordinate, from there to the second intermediate coordinate, and so on, finishing the polyline or the ending coordinate.
  • IndexedLineSet {
  • set_colorIndex # eventIn MFInt32
  • set_coordIndex # eventIn MFInt32
  • color NULL # exposedField SFNode
  • coord NULL # exposedField SFNode
  • colorIndex [] # field MFInt32
  • colorPerVertex TRUE # field SFBool
  • coordIndex [] # field MFInt32
  • }

HTML version of Basic Foils prepared March 4 1998

Foil 143 IndexedLineSet Fields - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 IndexedLineSet Fields
IndexedLineSet defines a geometrical structure as a set of lines and may be used for the geometry field of a Shape node. It has color, coord, colorIndex, colorPerVertex and coordIndex fields
coord holds the set of coordinates,
coordIndex defines the path to connect the coordinates given in the coord field to build a polyline. Each value in the coordIndex is an integer index specifying a coordinate from coord field.
  • It is possible to define several polylines in the coordIndex field. Each polyline connects together a string of coordinate indexes up to the end of the index list or up to an index of -1.
  • The next coordinate index following a -1 starts a new polyline.

HTML version of Basic Foils prepared March 4 1998

Foil 144 IndexedLineSet Fields - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 IndexedLineSet Fields
color field hold the color and typically it hold a Color node.
If colorPerVertex field is TRUE, the colorIndex field defines the color of each point (vertex) by matching the color with the corresponding coordinate(or point). colorIndex must have -1's where coordIndex does and values of colorIndex point to color array
If colorPerVertex field has a value FALSE, then indices of colorIndex correspond to indices of polylines but again values are pointers to color array.

HTML version of Basic Foils prepared March 4 1998

Foil 145 IndexedFaceSet Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index IndexedFaceSet Node Examples and Definition for Foil 145(Examples and Definition)
The major difference between IndexedFaceSet and IndexedLineSet is that VRML browser automatically connects the starting coordinate and ending coordinate of IndexedFaceSet to obtain a closed polyline and fills this area and shades it to make it look solid.
IndexedFaceSet geometry node defines a set of such faces to create (the surface of) a general object of arbitrary shape and this node can be used in geometry field of a Shape node. Notice this is usual way in computer graphics of specifying objects
  • Usually one builds objects out of simple triangular faces

HTML version of Basic Foils prepared March 4 1998

Foil 146 IndexedFaceSet Pyramid Example I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index 2 examples of Pyramids for Foil 146
Shape {
geometry IndexedFaceSet {
coordIndex [ 0,4,3,-1, 0,3,2,-1 0,2,1,-1, 0,1,4,-1, 1,3,4,-1, 1,2,3,-1]
coord Coordinate {
point [ 0 5 0, -2.5 0 -2.5, 2.5 0 -2.5, 2.5 0 2.5, -2.5 0 2.5] }
color Color {
color [ 1 1 0, 0 1 1, 1 0 1, 0 1 0, 0 0 1, 1 1 0, 0 1 1,
1 0 1, 1 0 0, 0 1 0, 0 0 1, 1 1 0, 0 1 1, 1 0 1, 1 0 0, 0 1 0, 0 0 1 ] } }
appearance Appearance {
material Material { diffuseColor 1 1 0 ambientIntensity 0.1 }} }
Defines a Simple Colored Pyramid

HTML version of Basic Foils prepared March 4 1998

Foil 147 IndexedFaceSet Pyramid Example II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index 2 examples of Pyramids for Foil 147
coord Coordinate {
point [ 0 5 0, # Called Point 0
-2.5 0 -2.5, # Called Point 1
2.5 0 -2.5, # Called Point 2 2.5 0 2.5, # Called Point 3 -2.5 0 2.5 # Called Point 4
] }
The point field defines the vertices of the object
There are five points defined. The points are labeled from 0 to 4
Coordinate just defines points to be used later in IndexedFaceSet

HTML version of Basic Foils prepared March 4 1998

Foil 148 IndexedFaceSet Pyramid Example III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index 2 examples of Pyramids for Foil 148
geometry IndexedFaceSet {
coordIndex [ 0,4,3,-1, 0,3,2,-1 0,2,1,-1, 0,1,4,-1, 1,3,4,-1, 1,2,3,-1]
The coordIndex field has a list of vertex numbers which define triangles (indicated by terminating -1)
This implies square at bottom of Pyramid broken into 2 triangles
Vertex numbers are those whose position was specified in coord field

HTML version of Basic Foils prepared March 4 1998

Foil 149 IndexedFaceSet Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index IndexedFaceSet Node Examples and Definition for Foil 149(Examples and Definition)
IndexedFaceSet {
  • set_colorIndex # eventIn MFInt32
  • set_coordIndex # eventIn MFInt32
  • set_normalIndex # eventIn MFInt32
  • set_texCoordIndex # eventIn MFInt32
  • color NULL # exposedField SFNode
  • coord NULL # exposedField SFNode
  • normal NULL # exposedField SFNode
  • texCoord NULL # exposedField SFNode
  • colorIndex [] # field MFInt32
  • coordIndex [] # field MFInt32

HTML version of Basic Foils prepared March 4 1998

Foil 150 IndexedFaceSet Node - III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index IndexedFaceSet Node Examples and Definition for Foil 150(Examples and Definition)
ccw TRUE # field SFBool
creaseAngle 0 # field SFFloat
normalIndex [] # field MFInt32
normalPerVertex TRUE # field SFBool
solid TRUE # field SFBool
texCoordIndex [] # field MFInt32
}
coord, coordIndex, color field have the same role as in IndexedLineSet.
If colorPerVertex is FALSE, then the colors from the Color node are used for each face. Otherwise, colors define a color of each vertex and color of face is calculated by averaging the color of its vertices.

HTML version of Basic Foils prepared March 4 1998

Foil 151 IndexedFaceSet Node - IV

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index IndexedFaceSet Node Examples and Definition for Foil 151(Examples and Definition)
ccw convex solid creaseangle are shared by ElevationGrid Extrusion and IndexedFaceSet and are used to speed up and clarify rendering strategy for solids
ccw field defines whether the faces in the face set are indexed in counter clockwise order or not. (ignored if solid true)
convex field defines whether all the faces in the face set are convex or not. If faces are concave, then VRML splits them into convex faces before drawing them.
solid field if TRUE indicates that Shape encloses a volume and one can use so-called backface culling
creaseAngle field defines a crease angle threshold (in radians). Adjacent faces with an angle between them smaller than the crease-angle threshold are smoothly shaded to obscure the edge between them.

HTML version of Basic Foils prepared March 4 1998

Foil 152 Color Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Color, Instancing, Grouping, Animation, Color Interpolation(Color, Instancing, Grouping, Animation, Color Interpolation)
Color {color [] # exposedField MFColor }
Each element of color field contains three floating point number to define the RGB color. Elements are indexed beginning from the 0.
Points' colors can be set by Color node, by Material node, or both according to the following rules:
  • If none of them specified, all points are black.
  • If only Material node is specified, the colors in the Material node define the colors of each point.
  • If only Color node is specified, the points are colored according to this node's definition.
  • If both of them are specified, then the Material node's diffuseColor and emissiveColor fields are ignored and Color node's definition is used as a color of points while points are shaded using the overall attributes of the Material node such as transparency.

HTML version of Basic Foils prepared March 4 1998

Foil 153 ElevationGrid Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of ElevationGrid
ElevationGrid { set_height # eventIn MFFloat color NULL # exposedField SFNode normal NULL # exposedField SFNode texCoord NULL # exposedField SFNode height [] # field MFFloat ccw TRUE # field SFBool colorPerVertex TRUE # field SFBool creaseAngle 0 # field SFFloat normalPerVertex TRUE # field SFBool solid TRUE # field SFBool xDimension 0 # field SFInt32 xSpacing 0.0 # field SFFloat zDimension 0 # field SFInt32 zSpacing 0.0 # field SFFloat }
Defines a two dimensional array in x-z plane with height given in height
texCoord is critical to drape interesting land structure over this framework

HTML version of Basic Foils prepared March 4 1998

Foil 154 Example of ElevationGrid Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of ElevationGrid
[ elevationgrid.wrl ]
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/elevationgrid.wrl

HTML version of Basic Foils prepared March 4 1998

Foil 155 Extrusion Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of Extrusion Shape
Extrusion { set_crossSection # eventIn MFVec2f set_orientation # eventIn MFRotation set_scale # eventIn MFVec2f set_spine # eventIn MFVec3f beginCap TRUE # field SFBool ccw TRUE # field SFBool convex TRUE # field SFBool creaseAngle 0 # field SFFloat crossSection [1 1, 1 -1, -1 -1, -1 1 , 1 1] # field MFVec2f endCap TRUE # field SFBool orientation 0 0 1 0 # field MFRotation -- can be array scale 1 1 # field MFVec2f -- can be array solid TRUE # field SFBool spine [0 0 0, 0 1 0] # field MFVec3f }
Roughly take the 2D crossSection shape and extend to 3D with spine (vertical extension) using modification given by scale and orientation.

HTML version of Basic Foils prepared March 4 1998

Foil 156 Example of Extrusion Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of Extrusion Shape
[ extrusion.wrl ]
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/extrusion.wrl

HTML version of Basic Foils prepared March 4 1998

Foil 157 Shading and Normals

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
The brightness of a face in VRML shape depends on how much it is lit by light in the VRML world. The more a face is oriented toward a light, the more brightly it is shaded by the VRML browser.
  • Surface normal determines the orientation of the surface.
VRML browser measures the angle between the light rays and the normal of the surface and calculates the shading of that surface.
It is also possible to provide the surface normals so that the browser does not spend time to calculate them.
IndexedFaceSet and ElevationGrid node have a normal field. By using a Normal node, it is possible to define these surface normals
  • Normal {
  • vector [] # exposedField MFVec3f
  • }
vector field specifies a list of unit normal vectors that may be used as normals for a shape.

HTML version of Basic Foils prepared March 4 1998

Foil 158 Texture - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of Texture for Lego Car
Texture mapping is a technique used to add detail to a world without creating shapes for every small part of it.
  • e.g. Rather than use hundreds of triangles to specify side of house, use a few to specify side of house and texture map an image with windows and doors.
It is possible to texture map any VRML shape, except those created by using PointSet or IndexedLineSet nodes.
Image files are used in a texture map by specifying their URL.
VRML texture image files can contain a single texture image or a movie containing a series of texture images, like the frames in film.
JPEG and GIF file formats are used for nonmovie texture images and MPEG format is used for movie images.
PNG can be used for a nonmovie texture. PNG stands for Portable Network Graphics and it is still in development phase. It is specifically designed for the Web applications.

HTML version of Basic Foils prepared March 4 1998

Foil 159 Texture - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
When a color texture image is in use, the colors in the texture image are mapped to parts of a VRML shapes as if those shapes were being painted and diffuseColor field of the shape Material node is ignored so that the remaining fields of the Material node is still apply such as transparency.
When a gray scale texture image is in use, the gray level values of each pixel is multiplied with the diffuseColor field of the shape Material node.
Some texture image file formats can optionally store a transparency level for each pixel.
When an image with pixel transparency is texture mapped to a shape, the pixel tranparencies control transparency from point to point across the shape.
ImageTexture, PixelTexture and MovieTexture nodes can be used to specify a texture for mapping to a shape. These nodes can be used texture field of Appearance node.

HTML version of Basic Foils prepared March 4 1998

Foil 160 ImageTexture

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of ElevationGrid
ImageTexture {
url [] # exposedField MFString
repeatS TRUE # field SFBool
repeatT TRUE # field SFBool
}
The ImageTexture node can provide the URL address of a texture image file in JPEG, GIF, or PNG file format.
url field specifies a list of URL addresses for the texture image file.
PixelTexture node can specify the pixel values explicitly, one by one, from left to right and bottom to top for an image so that we do not need to mention any file name address in the VRML file.
S and T are "x" and "y" for a texture map and repeatS/repeatT if true specify automatic wrapping of image over Shape
  • Fields such as texCoord and texCoordIndex map S and T to geometry of shape

HTML version of Basic Foils prepared March 4 1998

Foil 161 An Example ImageTexture

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 Example of Texture Map
[ can.wrl ]
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/can.wrl

HTML version of Basic Foils prepared March 4 1998

Foil 162 PixelTexture Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index VRML2.0 PixelTexture Node
PixelTexture {
image 0 0 0 # exposedField SFImage
repeatS TRUE # field SFBool
repeatT TRUE # field SFBool
}
image field specifies the image size and pixel values for a texture image used to texture map a shape. The first three integer values in the image field are
The width of the image, in pixels
  • The height of the image, in pixels
  • The number of 8-bit bytes for each pixel. (0: disable textureing for the shape, 1: Grayscale, 2: Grayscale with alpha, 3: RGB, 4: RGB with alpha) Integer pixel values are typically specified using hexadecimal notation.

HTML version of Basic Foils prepared March 4 1998

Foil 163 MovieTexture Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Elevation Grid, Color Interpolation, Billboard, and Movie Texture(Elevation Grid, Color Interpolation, Billboard, and Movie Texture)
MovieTexture node can specify an MPEG movie texture file for texture mapping.
  • MovieTexture {
  • loop FALSE # exposedField SFBool
  • speed 1 # exposedField SFFloat
  • startTime 0 # exposedField SFTime
  • stopTime 0 # exposedField SFTime
  • url [] # exposedField MFString
  • repeatS TRUE # field SFBool
  • repeatT TRUE # field SFBool
  • duration_changed # eventOut SFFloat
  • isActive # eventOut SFBool
  • }

HTML version of Basic Foils prepared March 4 1998

Foil 164 MovieTexture Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Elevation Grid, Color Interpolation, Billboard, and Movie Texture(Elevation Grid, Color Interpolation, Billboard, and Movie Texture)
startTime field specifies the time at which the movie texture strarts playing.
stopTime field spefies the time at which the movie texture stops playing.
speed field specifies the multiplication factor for speeding/slowing and going forward or backward
  • 0 <= speed < 1 : slows down the forward play
  • speed == 1 : normal forward play
  • speed > 1 : speeds up the forward play
  • speed ɘ : backward play
loop field specifies whether the movie playback loops or not.
The number of frames in the movie determines the movie's duration. As soon as the movie is read in by the browser, the movie's duration, measured in seconds, is determined and output on the duration_changed eventOut.

HTML version of Basic Foils prepared March 4 1998

Foil 165 Texture Mapping with S and T

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
With image textures, it is considered that it has a 2-D graph and x axis is called S axis and y axis is called as T axis.
Texture image always extends from 0.0 to 1.0 in the S (x) direction and from 0.0 to 1.0 in the T (y) direction in the texture coordinate system.
TextureCoordinate only has a point field and specifies a list of texture coordinates and may be used as the value of the texCoord field in the IndexedFaceSet and ElevationGrid nodes.
  • This is "pointed to" by texCoordIndex field
It is possible to give a point in a TextureCoordinate node which is outside of the texture image such as beyond the left, right, bottom, or top edges of the image.
  • When wrapping (repeatS/repeatT) is allowed, coordinates above the top of the image wrap to the bottom of the image, and coordinates below the bottom edge wrap back to the top, and so on.
When wrapping is not in use, it is called clamping. This mode is useful to make sure that a texture image occurs just once. Clamping restricts the texture images in the S, T, or both directions to lie in range 0 to 1.
repeatS and repeatT fields of texture nodes specifies whether wrapping is on or off in the corresponding Coordinate.

HTML version of Basic Foils prepared March 4 1998

Foil 166 Controlling Detail and Rendering Time

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
As the detail in the VRML world increases, VRML browser spends more time to load it and run it. To keep some balance between a detailed representation and a quick rendering is vital.
One technique is try to take advantage of the fact that shapes farther away from the viewer in the world need not be rendered with much detail as the ones which are closer to the viewer. This is called as level-of-detail technique.
  • LOD {
  • level [] # exposedField MFNode
  • center 0 0 0 # field SFVec3f
  • range [] # field MFFloat
  • }

HTML version of Basic Foils prepared March 4 1998

Foil 167 VRML97 Level Of Detail LOD Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Example and Definition of Levelof Detial LOD Node for Foil 167(Example and Definition)
Terrain Renderer in VRML is a good example of use of LOD Node
This group node is used to allow applications to switch between various representations of objects automatically.
The children of this node typically represent the same object or objects at varying levels of detail, from highest detail to lowest.
The specified center point of the LOD is transformed by the current transformation into world space, and the distance from the transformed center to the world-space eye point is calculated.
If the distance is less than the first value in the ranges array, then the first child of the LOD group is drawn.
If between the first and second values in the ranges array, the second child is drawn, etc.

HTML version of Basic Foils prepared March 4 1998

Foil 168 VRML97 Level Of Detail LOD Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Example and Definition of Levelof Detial LOD Node for Foil 168(Example and Definition)
If there are N values in the ranges array, the LOD group should have N+1 children.
Specifying too few children will result in the last child being used repeatedly for the lowest levels of detail;
If too many children are specified, the extra children will be ignored.
Each value in the range array should be less than the previous value, otherwise results are undefined.
FILE FORMAT/DEFAULTS
LOD {
exposedField MFNode level []
field SFVec3f center 0 0 0 # (-,)
field MFFloat range [] # (0,)
}

HTML version of Basic Foils prepared March 4 1998

Foil 169 Fields in a LOD Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Example and Definition of Levelof Detial LOD Node for Foil 169(Example and Definition)
level field contains Shape nodes and other grouping nodes. Here Inline node is a good tool to use. The first child provides the highest-detail version of the shape, and subsequent children provide lower-detail version, and so on.
center field specifies the 3-D coordinate in the coordinate for the shape built within the LOD node.
range field specifies a list of viewer-to-the center of shape distances at which the browser should switch from one level of detail to another.
  • If there are n versions of detailed representation of a shape in the level field, there must be (n-1) range values. Range values must be positive and in increasing order.

HTML version of Basic Foils prepared March 4 1998

Foil 170 Sound Effects

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
Adding sound to the VRML world involves two components: the sound source and the sound emitter.
  • The sound source provides a sound signal. The sound emitter turns the source's signal into sound that the audience can hear.
AudioClip and MovieTexture nodes provide the sound source component.

HTML version of Basic Foils prepared March 4 1998

Foil 171 AudioClip Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Collison, AudioClip, PointLight, Texture map, and Background(Collison, AudioClip, PointLight, Texture map, and Background)
AudioClip {
description "" # exposedField SFString
loop FALSE # exposedField SFBool
pitch 1.0 # exposedField SFFloat
startTime 0 # exposedField SFTime
stopTime 0 # exposedField SFTime
url [] # exposedField MFString
duration_changed # eventOut SFTime
isActive # eventOut SFBool }
url field specifies a sound file that is in WAV or MIDI file format.

HTML version of Basic Foils prepared March 4 1998

Foil 172 AudioClip Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Collison, AudioClip, PointLight, Texture map, and Background(Collison, AudioClip, PointLight, Texture map, and Background)
startTime and stopTime fields specify the absolute times at which a sound starts and stops playing.
loop field indicates whether a sound should be played just once or played repeatedly in a loop.
pitch field controls the speed with which a sound source is played.
A MovieTexture node may be used as a sound source only if the movie file referenced by the url field in the MPEG-1 Systems format.
The Sound node describes a sound emitter in the VRML world.

HTML version of Basic Foils prepared March 4 1998

Foil 173 Sound Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Spacial Sound w/ Touch Sensor, & Keyframe Animation(Spacial Sound w/ Touch Sensor, & Keyframe Animation)
Sound {
direction 0 0 1 # exposedField SFVec3f
intensity 1 # exposedField SFFloat
location 0 0 0 # exposedField SFVec3f
maxBack 10 # exposedField SFFloat
maxFront 10 # exposedField SFFloat
minBack 1 # exposedField SFFloat
minFront 1 # exposedField SFFloat
priority 0 # exposedField SFFloat
source NULL # exposedField SFNode
spatialize TRUE # field SFBool
}
location field specifies a 3-D coordinate for the location of the sound emitter in the current coordinate system.

HTML version of Basic Foils prepared March 4 1998

Foil 174 Fields in Sound Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Spacial Sound w/ Touch Sensor, & Keyframe Animation(Spacial Sound w/ Touch Sensor, & Keyframe Animation)
direction field specifies a 3-D vector indicating the aim direction for the sound emitter.
intensity field controls the volume of sound emitter. Value 1.0 sets te volume to maximum and 0.0 reduces the volume to zero( turn off the sound emitter).
source field specifies the sound source for the sound node.
priority field gives the author some control over which sounds the browser will choose to play when there are more sounds active than sound channels available.
Browsers should support spatial localization of sound as well as their underlying sound libraries will allow. The spatialize field is used to indicate to browsers that they should try to locate this sound.
minFront and minBack determine the extent of the full intensity region in front of and behind the sound.

HTML version of Basic Foils prepared March 4 1998

Foil 175 Adding Background to the VRML World - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Collison, AudioClip, PointLight, Texture map, and Background(Collison, AudioClip, PointLight, Texture map, and Background)
VRML's backgroud features provide a control over the world's sky and ground colors and enables to specify a set of panorama images to be placed around, above, and below the VRML world. VRML world's sky is an infinitely large sphere placed around the world. It covers the ground as well. The panorama is built a using an infinitely large cube placed around the world but just inside the sky and the ground spheres.
frontUrl, backUrl, leftUrl, rightUrl, topUrl, and bottomUrl fields of Background node specifies the URL addresses of the corresponding surfaces.
skyColor defines a list of RGB colors to paint the sky.
groundColor defines a list of RGB colors to paint the ground.

HTML version of Basic Foils prepared March 4 1998

Foil 176 The Background Scenarios

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Collison, AudioClip, PointLight, Texture map, and Background(Collison, AudioClip, PointLight, Texture map, and Background)
Top View Side View

HTML version of Basic Foils prepared March 4 1998

Foil 177 Adding Background to the VRML World - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Collison, AudioClip, PointLight, Texture map, and Background(Collison, AudioClip, PointLight, Texture map, and Background)
Background {
set_bind # eventIn SFBool
groundAngle [] # exposedField MFFloat
groundColor [] # exposedField MFColor
backUrl [] # exposedField MFString
bottomUrl [] # exposedField MFString
frontUrl [] # exposedField MFString
leftUrl [] # exposedField MFString
rightUrl [] # exposedField MFString
topUrl [] # exposedField MFString
skyAngle [] # exposedField MFFloat
skyColor [ 0 0 0 ] # exposedField MFColor
isBound # eventOut SFBool
}

HTML version of Basic Foils prepared March 4 1998

Foil 178 Creating A Virtual Atmosphere Effect

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Fog node also w/ Proximity sensors(Fog node also w/ Proximity sensors)
By using a Fog node, a light haze or a thick, pea-soap fog can be produced. It is also possible to define a color for this fog effect.
  • Fog {
  • color 1 1 1 # exposedField SFColor
  • fogType "LINEAR" # exposedField SFString
  • visibilityRange 0 # exposedField SFFloat
  • set_bind # eventIn SFBool
  • isBound # eventOut SFBool
  • }
color specifies the RGB color of a fog.
visibilityRange specifies the maximum distance between viewer and the shapes in the world so that the shapes which are away from the viewer can not be seen by the viewer because of the fog effect.
fogType defines the interpolation of fog thickness with repect to the distance between shape and viewer. It can be LINEAR or EXPONENTIAL.

HTML version of Basic Foils prepared March 4 1998

Foil 179 Viewpoints -- Overview

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and 2 Examples of Viewpoint Nodes for Foil 179(Definition and Examples)
A viewpoint is a predefined viewing position and orientation in the VRML world. Viewpoint node allows to define the location and viewing direction for the viewpoint. This node is generally added to the children of the Transform node and when the coordinate system moves, so does the viewpoint.
Switching from one viewpoint to another is handled by the browser's user interface and browsers have well defined ways of changing viewpoint.
  • Viewpoint {
  • set_bind # eventIn SFBool
  • fieldOfView 0.785398 # exposedField SFFloat
  • jump TRUE # exposedField SFBool
  • orientation 0 0 1 0 # exposedField SFRotation
  • position 0 0 10 # exposedField SFVec3f
  • description "" # field SFString
  • bindTime # eventOut SFTime
  • isBound # eventOut SFBool
  • }

HTML version of Basic Foils prepared March 4 1998

Foil 180 Fields in Viewpoint Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and 2 Examples of Viewpoint Nodes for Foil 180(Definition and Examples)
position field specifies a 3-D coordinate for the location of viewpoint in the current coordinate system.
orientation field specifies a rotation axis and angle with which to rotate the viewpoint.
fieldOfView field specifies an angle(in radians) indicating the spread angle of the viewpoints viewing-volume frustrum.
  • The range of the world that is visible to VRML viewpoint can be illustrated by a tapered box with the narrow end at the viewpoint and the wide end at the horizon (called a frustrum).
  • Any shape that falls within the box is visible. As we decrease the field of angle, we taper the box, making it more narrow and decrease the range of the world that is visible.

HTML version of Basic Foils prepared March 4 1998

Foil 181 Viewpoint Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Definition and 2 Examples of Viewpoint Nodes for Foil 181(Definition and Examples)
description field specifies a text string used to describe the viewpoint.
Viewpoints are kept in a stack and the top of the stack is current viewpoint.
  • Background, Fog, NavigationInfo also are done in this stack fashion
When a jump (is TRUE) viewpoint is placed on top of the viewpoint stack, the viewer automatically jumps to that Viewpoint node's position, orientation, and field of view.
When a no-jump viewpoint is placed on top of the viewpoint stack, by selecting it from a browser's menu for example, the user retains his or her current view.
In any case, the viewer's movements are now relative to the new current viewpoint node and to the coordinate system in which that viewpoint is built.

HTML version of Basic Foils prepared March 4 1998

Foil 182 Avatars

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index
An avatar is a symbolic-virtual-world representation of a real-world person in virtual reality. Using an avatar, the real-world person moves through the virtual world, seeing what the avatar sees, and interacting by telling the avatar what to do. In a multi-user virtual reality environment, each user in the environment chooses a 3-D shape as a represantative in the VRML world.
A description of an avatar can be divided into two sections:
  • what an avatar looks like
  • how an avatar can move
The movement features of the avatar are primarily controlled by the NavigationInfo node.

HTML version of Basic Foils prepared March 4 1998

Foil 183 NavigationInfo Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Navigation Information w/ Viewpoint binding, and Trans gifs(Navigation Information w/ Viewpoint binding, and Trans gifs)
NavigationInfo {
set_bind # eventIn SFBool
avatarSize [ 0.25, 1.6, 0.75 ] # exposedField MFFloat
headlight TRUE # exposedField SFBool
speed 1.0 # exposedField SFFloat
type "WALK" # exposedField MFString
visibilityLimit 0.0 # exposedField SFFloat
isBound # eventOut SFBool }
These parameter values are typically set in Browser window
type field specifies the style of motion such as WALK, FLY, EXAMINE and NONE.

HTML version of Basic Foils prepared March 4 1998

Foil 184 NavigationInfo Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 98. *
Full HTML Index Bakers Example - Navigation Information w/ Viewpoint binding, and Trans gifs(Navigation Information w/ Viewpoint binding, and Trans gifs)
speed defines the recommended avatar motion speed, measured in units per second.
avatarSize field defines the size characteristics of the viewer's avatar.
headlight field turns on/off the avatar's headlight. A headlight is a directional light that always points in the direction the user is looking. Setting this field to TRUE allows the browser to provide a headlight, possibly with user interface controls to turn it on and off.
visibilityLimit field defines the distance to the far end of the viewing-volume frustrum and establishes the farthest distance the viewer can see.

© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Nov 29 1998