X3D: Extensible 3D Graphics for Web Authors
DON B R U T Z M A N
Naval Postgraduate School, Monterey, California, USA and
LEONARD DALY
Daly Realism, Los Angeles, California, USA
AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO
ELSEVIER
Morgan Kaufmann Is an Imprint of Elsevier
MORGAN
KAUFMANN
PUBLISHERS
Contents
Preface 1. 2. 3. 4. 5. Goals Motivation Reader background . / Software support Book structure 5.1. Typographic conventions 5.2. Chapter organization Chapter 6.1. 6.2. 6.3. descriptions Chapter topics Appendices How to use this book
xix xix xxi xxi xxi xxi xxi xxii xxii xxii xxiv xxiv
xxv xxv ii
6.
Contributor List About the Authors
CHAPTER 1
Technical Overview 1. 2. Introduction Concepts
2.1. 2.2. 2.3. 2.4. Historical background: VRML, ISO, and the Web3D Consortium' X3D browsers X3D specifications Scene graph
1 1 2
2 3 5 7
vii
viii
Contents
2.5.
2.6. 2.7. 2.8.
2.9. 3.
File structure 2.5.1. File header 2.5.2. X3D header statement 2.5.3. Profile statements 2.5.4. Component statements 2.5.5. Meta statements 2.5.6. Scene graph body Field types Abstract node types \ File encodings: XML, ClassicVRML, and Compressed 2.8.1. Extensible Markup Language (XML) encoding: .x3d files 2.8.1.1. XML motivations 2.8.1.2. XML design for X3D 2.8.1.3. XML validatibn 2.8.2. ClassicVRML encoding: .x3dv files 2.8.3. Binary encoding: .x3db files Hello World example using X3D-Edit and an X3D browser
10 10 10 12 14 15 18 18 20 20 21 22 24 25 27 29 32 35 35 35
Summary 3.1. Key ideas 3.2. Next chapters
CHAPTER 2
Geometry Nodes, Part l: Primitives
1. 2. W h a t this chapter covers Concepts 2.1. Purpose and common functionality 2.2. Common field 2.2.1. Solid 2.3. Abstract node types 2.3.1. X3DShapeNode type 2.3.2. X3DGeometryNode type 2.3.3. X3DFontStyleNode type 2.4. Hints and warnings N o d e descriptions 3.1. Shape node 3.1.1. Hints and warnings
37
37 38 38 40 40 41 41 41 41 41 42 42 42
3.
Contents
3.2.
3.3.
3.4.
3.5. 3.6. 3.7. 4.
Box node 3.2.1. Size 3.2.2. Hints and warnings Cone node 3.3.1. bottomRadius and height 3.3.2. bottom and side Cylinder node 3.4.1. radius and height 3.4.2': bottom, side, and top 3.4.3. Hints and warnings Sphere node Text node FontStyle node
44 46 46 46 48 48 49 49 50 50 50 54 55 62 62 63 63
Summary ,> 4.1. Key ideas 4.2. Related nodes and concepts 4.3. Next chapter
CHAPTER 3
Grouping Nodes
1. 2. What this chapter covers Concepts
2.1. 2.2. 2.3. 2.4. 2.5. Purpose and common functionality Units of measurement and coordinate systems Coordinate system details DEF and USE Abstract node types 2.5.1. X3DChildNode type 2.5.2. X3DBoundedObject type 2.5.3. X3DGroupingNode type 2.5.4. X3DInfoNode type 2.5.5. X3DUrlObject abstract interface
65
65 66
66 66 69 71 72 72 73 73 74 75 75 75 77 82 85 89
3.
N o d e descriptions 3\1. Group and StaticGroup nodes 3.2. Transform node 3.3. Inline node 3.4. LOD node 3.5. Switch node
Contents
4.
Summary
4.1. 4.2. 4.3. Key ideas Related nodes and concepts Next chapter
93
93 93 93
CHAPTER 4
Viewing and Navigation
1. 2. What this chapter covers Concepts
2.1. 2.2. 2.3. 2.4. 2.5. 3. Purpose and common functionality Viewing model Navigation model Collision detection and terrain following ..'.'' Abstract node types 2.5.1. X3DBindableNode type
95
95 95
96 96 97 97 97 97 101 101 106 Ill 114 117 118 118 120 120
N o d e descriptions 3.1. Viewpoint node 3.2. Navigationlnfo node 3.3. Anchor node 3.4. Billboard node 3.5. Collision node Summary 4.1. Key ideas 4.2. Related nodes and concepts 4.3. Next chapter
4.
CHAPTER 5
Appearance, Material, and Textures
1. 2. What this chapter covers Concepts
2.1. 2.2. Purpose and common functionality Abstract node types 2.2.1. X3DAppearanceNode and X3DAppearanceChildNode types 2.2.2. X3DMaterialNode type 2.2.3. X3DTextureNode, X3DTextureCoordinateNode, and X3DTextureTransformNode types
121
121 122
122 123 123 124 124
Contents
2.2.4. 2.2.5. 3.
X3DTexture2DNode type X3DTextureTransform2DNode type
124 125 125 125 126 132 134 137 140 143 146 150 152 155 155 155 155
N o d e descriptions 3.1. Appearance node 3.2. Material node 3.3. FillProperties node 3.4. LineProperties node *--..-3.5. ImageTexture node 3.6. MovieTexture node 3.7. PixelTexture node 3.8. TextureTransform node 3.9. TextureCoordinate node 3.10. TextureCoordinateGenerator node Summary 4.1. Key ideas 4.2. Related nodes and concepts 4.3. Next chapter
4.
CHAPTER 6
G e o m e t r y N o d e s , P a r t 2 : P o i n t s , L i n e s , a n d P o l y g o n s . . . . 157
1. 2. W h a t this chapter covers Concepts 2.1. Purpose and common functionality 2.2. Common geometry fields N o d e descriptions 3.1. Color and ColorRGBA nodes 3.2. Coordinate and CoordinateDouble nodes 3.3. PointSet node 3.4. IndexedLineSet node 3.5. LineSet node 3.6. IndexedFaceSet node 3.7. ElevationGrid node 3.8. Extrusion node ' Summary 4.1. Key ideas 4.2. Related nodes and concepts 4.3. Next chapter r 157 158 158 159 162 162 163 165 167 170 172 174 178 184 184 185 185
3.
4.
xii
Contents
CHAPTER 7
Event Animation and Interpolation
1. 2. What this chapter covers Concepts
2.1. J 2.2. 2.3. 2.4. 2.5. 2.6. Animation as scene-graph modification Purpose and common functionality ROUTE connections Interpolation Constructing animation chains: 10 steps Abstract node types 2.6.1. X3DTimeDependentNode type 2.6.2. X3DSensorNode type 2.6.3. X3DInterpolatorNode type ., TimeSensor node Scalarlnterpolator node Colorlnterpolator node Positionlnterpolator node Orientationlnterpolator node Normallnterpolator node Coordinatelnterpolator node PositionInterpolator2D node CoordinateInterpolator2D node
187
187 188
188 188 189 190 192 196 196 196 196
3.
Node descriptions
3.1. 3.2. 3.3. 3.4. 3.5. 3.6. 3.7. 3.8. 3.9.
200
200 204 205 210 211 214 215 216 218 219 219 220 220
4.
Summary 4.1. Key ideas 4.2. Related nodes and concepts 4.3. Next chapter
CHAPTER 8
User Interactivity Nodes
1. 2. What this chapter covers Concepts
2.1. 2.2. 2.3. Purpose and common functionality X3DSensorNode type X3DPointingDeviceSensorNode type
221
221 ' 222
222 223 223
Contents
xiii
2.4. 2.5. 2.6. 3.
X3DTouchSensorNode type X3DDragSensorNode type X3DKeyDeviceSensorNode type
225 225 226 227 227 231 234 239 241 244 246 246 247 247
N o d e descriptions 3.1. TouchSensor node 3.2. PlaneSensor node 3.3. CylinderSensor node *-J5.4. SphereSensor node 3.5. KeySensor node 3.6. StringSensor node Summary 4.1. Key ideas 4.2. Related nodes and concepts 4.3. Next chapter. .'.
4.
CHAPTER 9
Event Utilities and Scripting
1. 2. What this chapter covers Concepts
2.1. 2.2. 2.3. 2.4. 3. Purpose and common functionality X3DScriptNode type X3DSequencerNode type X3DTriggerNode type
249
249 250
250 251 251 254 254 254 256 258 259 259 261 263 264 278 278 278 278
N o d e Descriptions 3.1. BooleanFilter node 3.2. BooleanSequencer node 3.3. BooleanToggle node 3.4. BooleanTrigger node 3.5. IntegerSequencer node 3.6. IntegerTrigger node 3.7. TimeTrigger node 3.8. Script node Summary 4.1. Key ideas 4.2. Related nodes and concepts 4.3. Next chapter
4.
xiv
Contents
CHAPTER 10
Geometry Nodes, Part 3: Geometry2D Nodes
1. 2. What this chapter covers Concepts . 2.1. Purpose and common functionality 2.2. Common geometry fields Node descriptions 3.1. Arc2D node 3.2. ArcClose2D node 3.3. Circle2D node 3.4. Disk2D node 3.5. Polyline2D node 3.6. Polypoint2D node 3.7. Rectangle2D node 3.8. TriangleSet2D node Summary 4.1. Key ideas 4.2. Related nodes and concepts 4.3. Next chapter 7
279
279 280 280 281 281 281 282 285 287 289 291 292 293 296 296 296 296
3.
.'
4.
CHAPTER 11
Lighting and Environment Nodes
1. 2. What this chapter covers Concepts 2.1. Purpose and common functionality 2.2. X3DLightNode type 2.3. X3DBackgroundNode type Node descriptions 3.1. DirectionalLight node 3.2. Headlight 3.3. PointLight node 3.4. SpotLight node 3.5. Background node 3.6. TextureBackground node 3.7. Fog node
299
299 300 302 303 306 308 308 309 311 315 319 321 322
3.
Contents
4.
Summary
4.1. 4.2. 4.3. Key ideas Related nodes and concepts Next chapter
325
325 326 326
CHAPTER 12
Environment Sensor and Sound Nodes
1. 2. What this chapter covers Concepts
2.1. 2.2. 2.3. 2.4. X3DEnvironmentSensorNode type X3DNetworkSensorNode type X3DSoundNode type X3DSoundSourceNode type LoadSensor node ProximitySensor node VisibilitySensor node Sound node AudioClip node
327
327 328
328 329 330 330
3.
Node descriptions
3.1. 3.2. 3.3. 3.4. 3.5.
330
330 334 339 340 347 351 351 351 351
4.
Summary 4.1. Key ideas 4.2. Related nodes and concepts 4.3. Next chapter
CHAPTER 13
G e o m e t r y N o d e s , Part 4 : T r i a n g l e s a n d Q u a d r i l a t e r a l s . . . 353
1. 2. What this chapter covers Concepts
2.1. 2.2. Purpose and common functionality Abstract node types 2.2.1. X3DColorNode, X3DCoordinateNode, X3DGeometricPropertyNode, X3DGeometryNode, and X3DNormalNode types 2.2.2. X3DComposedGeometryNode type Common geometry fields
353 354
354 355
2.3.
355 356 356
xvi
Contents
3.
Node descriptions
3.1. 3.2. 3.3. 3.4. 3.5. 3.6. 3.7. 3.8. 3.9. Normal node TriangleSet node TriangleFanSet node TriangleStripSet node QuadSet node IndexedTriangleSet node IndexedTriangleFanSet node IndexedTriangleStripSefnode IndexedQuadSet node
361
361 363 366 368 370 370 373 375 377 378 378 379 379
4.
Summary 4.1. Key ideas 4.2. Related nodes and concepts 4.3. Next chapter
,'
CHAPTER 14
Creating Prototype Nodes
1. 2. What this chapter covers Concepts
2.1. 2.2. 2.3. 2.4. 3. Extensibility Strong typing of nodes Comparison with Inline node Syntax alert
38i
381 382
382 383 383 383 384 384 394 397 398 398 399
Functional descriptions 3.1. Prototype declarations: ProtoDeclare 3.2. External prototype declarations: ExternProtoDeclare 3.3. Prototype instances: Protolnstance Summary 4.1. Key ideas 4.2. Related nodes and concepts
4.
Afterword: Getting Involved
Learning X3D Building Software
401
401 401
Contents
xvii
Creating Content X3D Development Other Web3D Activities
APPENDICES
402 402 402
A. Online Resources
Web Site Description
403
403
B. Help: X3D/VRML Examples
Applications, Players, a n d Plugins for X 3 D / V R M L Viewing . . . . Web3D Consortium Members Not (yet) Web3D Consortium Members Authoring Tools Authoring Support Conversion and Translation Tools Examples License PowerPoint Support References
405
405 405 406 406 407 407 408 409 409 409
C. X3D Scene Authoring Hints
Authoring practices Credits Dates HTML Images Inline and Prototype Subscenes License meta tags '
411
411 414 414 415 415 416 417 418
xviii
Contents
Naming Conventions Naming of Multiple Similar Autogenerated Files Scripts URL Links Viewpoints List of References-.^ ~
418 419 419 420 421 423
Index
425