Full HTML for

Basic foilset VRML 2 Basic Concepts and Definitions

Given by Zeynep Ozdemir(Geoffrey C. Fox) at CPS616 -- Information Track of CPS on Spring Semester 97. Foils prepared April 6 1997
Outside Index Summary of Material


See VRML Resources including many interesting examples
What is VRML2.0 and VRML97
Status of VRML2.0 Browsers
Features of VRML2.0 with changes from VRML1.0 -- Deletions and Additions
VRML2.0 File Format
Nodes, Fields, Events, Shapes, Routes, Sensors
Detailed Discussion of Specific Nodes without going into programming issues

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

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

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

Outside Index Summary of Material



HTML version of Basic Foils prepared April 6 1997

Foil 1 CPS616 Spring 97 Computational Science For the Information Age

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

HTML version of Basic Foils prepared April 6 1997

Foil 2 Table of Contents - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
1- The Virtual Reality Modeling Language (VRML2.0)
2- What is VRML97?
3- VRML2.0 Browsers
4- Features of VRML2.0
5- Changes from VRML1.0 New Node Types
6- Summary of New Features
  • Sensors
  • Scripts and Interpolators
  • Sound
  • Geometry
7- VRML2.0 File Format
8- Sample VRML File
9- Nodes
10- Fields and Events
11- Shapes
12- Grouping Nodes Children
13- Events and Route
14- ROUTE
15- Sensor
16- Prototype
17- IS Statement
18- Transform Node
19- Rotation

HTML version of Basic Foils prepared April 6 1997

Foil 3 Table of Contents - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
20- Scale
21- Material
22- Animation
23- User Interaction
24- Inline
25- Anchor
26- Text
27- Font Sytle
29- Light
30- Defining shapes with points, lines and faces
31- Shading
32- Texture
33- LOD
34- Sound Effect
35- Background
36- Viewpoints
37- Avatars
38- NavgationInfo

HTML version of Basic Foils prepared April 6 1997

Foil 4 VRML 2.0 The Virtual Reality Modeling Language

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 5 VRML 2.0 The Virtual Reality Modeling Language

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 6 What is VRML97?

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 will be submitted to ISO in March 1997 for a vote and finalized in June-July 97.

HTML version of Basic Foils prepared April 6 1997

Foil 7 VRML2.0 Browsers - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 8 PPT Slide

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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).
VRML2.0 Browsers - II

HTML version of Basic Foils prepared April 6 1997

Foil 9 PPT Slide

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
VRML2.0 Browsers - III
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 April 6 1997

Foil 10 Architecture of a VRML2.0 Browser

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

HTML version of Basic Foils prepared April 6 1997

Foil 11 Key Features of VRML 2.0

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 12 Changes from VRML 1.0 New VRML2.0 Node Types - I

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

HTML version of Basic Foils prepared April 6 1997

Foil 13 New VRML2.0 Node Types - Grouping - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Grouping Nodes
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 April 6 1997

Foil 14 New Node Types - Browser Information - III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 15 New Node Types - Browser Information - IV

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 16 New Node Types - Sound/Light - V

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 17 New Node Types - Shape/Geometry - VI

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 18 New Node Types - Geometry - VII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 19 New Node Types - Appearance/Properties - VII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 20 New Node Types - Scripting - VIII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 21 New Node Types - Sensors - VIII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 22 New Node Types - Sensors - IX

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 23 New Node Types - Sensors - X

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 24 New Node Types - Interpolators - X

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 25 New Node Types - Interpolators - XI

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 26 New Node Types - Interpolators - XII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 27 New Field Types - XIII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
In addition to all of the other changes, 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 April 6 1997

Foil 28 Deleted Node Types - XIII

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 29 Deleted Node Types - XV

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 30 VRML 2.0 Nodes (Summary of New Features)

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 31 Sensors Interaction with the User

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 32 Scripts and Interpolators - I Behavior and Animation

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 33 Scripts and Interpolators - II Behavior and Animation

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 34 Sound in VRML2.0

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 35 Geometry Nodes Polygonal Description of the World

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 36 VRML File Structure

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 37 VRML File Header

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 38 A Sample VRML File - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
#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 April 6 1997

Foil 39 A Sample VRML File - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 40 A Sample VRML File - III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

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

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

HTML version of Basic Foils prepared April 6 1997

Foil 42 VRML2.0 Nodes - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 43 Nodes - Atrributes - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 44 Nodes - ExposedFields -III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 45 Fields and Events

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 46 Fields

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 47 Field Types - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 48 Field Types - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 49 Field Types - III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 50 Events

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 51 Naming Conventions for Fields/Events

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 52 Defining Node Names

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 53 Shapes

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 54 Shape and Appearance Node Syntax

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 55 4 Primitive Geometries

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 56 Shape Example - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
#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 April 6 1997

Foil 57 Shape Example - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
#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 April 6 1997

Foil 58 Grouping Shapes -- Children

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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.

HTML version of Basic Foils prepared April 6 1997

Foil 59 PPT Slide

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
[ prim.wrl ]
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/prim.wrl
A Sample file for Shapes & Groups

HTML version of Basic Foils prepared April 6 1997

Foil 60 Group Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 61 Group Node Example

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 62 Billboard Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 63 A Sample Billboard Group

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

HTML version of Basic Foils prepared April 6 1997

Foil 64 Events and Routes

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 (eventOout) 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 April 6 1997

Foil 65 Execution Model for Event processing

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 66 Diagram of Execution Model for Event processing

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index

HTML version of Basic Foils prepared April 6 1997

Foil 67 ROUTE - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 68 ROUTE - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 69 Sensor Nodes - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 70 Sensor Nodes - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 71 Prototypes - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 definition section
  • eventOut SFColor foo2 # Names must be Unique
  • eventIn SFVec3f foo3
  • exposedField SFString foo4 # End definition
  • ] {.. prototype definition ..}

HTML version of Basic Foils prepared April 6 1997

Foil 72 Prototypes - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 73 Prototype Sample

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

HTML version of Basic Foils prepared April 6 1997

Foil 74 IS Statement

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 75 Transform Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 76 Transform Node Example

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
#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 April 6 1997

Foil 77 Rotation Field in Transform - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 78 Rotation Field - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 79 Rotation Example - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
#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 April 6 1997

Foil 80 Rotation Example - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 81 Scale Field in Transform

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index (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 April 6 1997

Foil 82 Scale Example - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index (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 April 6 1997

Foil 83 Scale Example - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index (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 April 6 1997

Foil 84 Scale Example - III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index (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 April 6 1997

Foil 85 Material Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 86 Material Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 87 Material Node - III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 88 Material Node - IV

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 89 Material Node - V

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 90 PPT Slide

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
[ slabs.wrl ]
http://www.npac.syr.edu/users/zeynep/VRML2.0_EXAMPLES/samples/slabs.wrl
A Sample World Using Appearance -Material

HTML version of Basic Foils prepared April 6 1997

Foil 91 Animation - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 92 Animation - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 93 PositionInterpolator - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 94 PositionInterpolator - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 95 An Example Using PositionInterpolators

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

HTML version of Basic Foils prepared April 6 1997

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

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 97 The First Stair in doorway.wrl

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 98 Animation Strategy in doorway.wrl

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 99 Animation Code for Stair1 in doorway.wrl

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 100 OrientationInterpolator

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 101 ColorInterpolator

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 102 ScalarInterpolator

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 103 NormalInterpolator Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 104 Handling User Interactions - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 105 Handling User Interactions - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 106 TimeSensor - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 107 TimeSensor - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 108 TouchSensor - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 109 TouchSensor - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 110 PlaneSensor

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 111 SphereSensor

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 112 CylinderSensor

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 113 VisibilitySensor Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 114 VisibilitySensor Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 115 ProximitySensor Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 116 ProximitySensor Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 117 Collision Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 118 Collision Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 119 Treatment of Multiple Sensors

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 120 Inline Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 121 A Sample Inlined File

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
[ 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 April 6 1997

Foil 122 Linking Different VRML Worlds

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 123 An Example of Anchor Node

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

HTML version of Basic Foils prepared April 6 1997

Foil 124 Text Node Definition

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 125 Text Node Notes

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 126 Font Style Node Definition - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 127 Font Style Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 128 Font Style Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 129 Lights - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 130 Lights - Pointlight Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 131 PointLight Node Fields - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 132 PointLight Node Fields - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 133 DirectionalLight Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 134 SpotLight Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 135 SpotLight Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 &#062 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 April 6 1997

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

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 137 PointSet Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 138 Binding Colors to points, lines, and faces

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 139 IndexedLineSet Fields - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 140 IndexedLineSet Fields - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 141 IndexedFaceSet Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 arbitary 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 April 6 1997

Foil 142 IndexedFaceSet Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 143 IndexedFaceSet Node - III

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 144 IndexedFaceSet Node - IV

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 145 Color Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 146 ElevationGrid Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 147 Example of ElevationGrid Node

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

HTML version of Basic Foils prepared April 6 1997

Foil 148 Extrusion Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 149 Example of Extrusion Node

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

HTML version of Basic Foils prepared April 6 1997

Foil 150 Shading and Normals

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 151 Texture - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 152 Texture - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 153 ImageTexture

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 154 An Example ImageTexture

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

HTML version of Basic Foils prepared April 6 1997

Foil 155 PixelTexture Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 156 MovieTexture Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 157 MovieTexture Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 &#060= speed &#060 1 : slows down the forward play
  • speed == 1 : normal forward play
  • speed &#062 1 : speeds up the forward play
  • speed &#0600 : backward play
loop field speficies 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 April 6 1997

Foil 158 Texture Mapping with S and T

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 159 Controlling Detail and Rendering Time

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 160 Fields in a LOD Node

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 161 Sound Effects

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 162 AudioClip Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 163 AudioClip Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 164 Sound Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 165 Fields in Sound Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 166 Adding Background to the VRML World - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 167 The Background Scenarios

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
Top View Side View

HTML version of Basic Foils prepared April 6 1997

Foil 168 Adding Background to the VRML World - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 169 Creating A Virtual Atmosphere Effect

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 170 Viewpoints -- Overview

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 171 Fields in Viewpoint Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 172 Viewpoint Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 173 Avatars

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
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 April 6 1997

Foil 174 NavigationInfo Node - I

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 April 6 1997

Foil 175 NavigationInfo Node - II

From VRML 2 Basic Concepts and Definitions CPS616 -- Information Track of CPS -- Spring Semester 97. *
Full HTML Index
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 Mar 15 1998