Download presentation
Presentation is loading. Please wait.
Published byHarold Rich Modified over 8 years ago
1
H3D API Training Part 2.1: X3D
2
Outline Scene graphs X3D – XML syntax X3D components overview
3
Scene Graph Group Transform Shape Box Shape Sphere“gold” children appearance geometry
4
Scene Graph The scene graph is a directed graph of nodes used to define and manage applications Hierarchical structure – children/parent. Each node affects its children.
5
What is a Node? ◦ A container for fields: ◦ Manages fields Allocation, deallocation of fields Initialisation of fields Manages internal (and external) routes ◦ Reusable modules of functionality ◦ Simplify application development
6
Nodes
7
X3D ISO standard for 3D content and interaction Backwards compatible with VRML www.web3d.org
8
X3D - XML “XML encoding” of X3D Similar in appearance to HTML (technically a subset of XML) Basic structure: ◦ Header ◦ Statements (scene graph nodes, routes)
9
Example
10
XML Objects encoded begin with a “<name” and end with either ◦ “/>” for single entities ◦ “ ” for compound entities
11
Comments Comments are enclosed within
12
X3D – DEF/USE
13
X3D – DEF/USE example Reference an existing DEFined Node with the USE attribute Useful to avoid data duplication / redundancy ◦ Especially with appearances ◦ Any mesh geometry that is identical
14
X3D - ROUTE Dependencies between field are set up with routes:
15
Example DEF/USE/ROUTE
16
X3D - containerField Indicates the default field that a node should be assigned to ◦ e.g. “child” for Group, Transform, Shape ◦ “appearance” for Appearance ◦ “geometry” for IndexedFaceSet, Sphere containerField hidden from most X3D and H3D use, but necessary to know about
17
X3D Components
18
Grouping Component Group ◦ Basic grouping. Transform ◦ Specifies coordinate system transformation. Switch ◦ Choose one of many children.
19
Geometry Component Shape Appearance Geometry ◦ Box ◦ Cone ◦ Sphere ◦ IndexedFaceSet ◦ etc
20
Texturing Component ImageTexture ◦ MultiTexture ◦ PixelTexture ◦ (MovieTexture) TextureTransform TextureCoordinate
21
Interpolator Component Useful for basic animations: ◦ ColorInterpolator ◦ CoordinateInterpolator ◦ NormalInterpolator ◦ OrientationInterpolator ◦ PositionInterpolator
22
Text Component Text FontStyle
23
Lighting Component DirectionalLight PointLight SpotLight
24
Other Components Time RigidBodyPhysics Rendering Sound Device Sensors Navigation Programmable shaders Particle system
25
X3D Abstract Nodes X3D specification defines abstract nodes; ◦ Cannot be instantiated / used ◦ Contain common functionality used in certain types of nodes ◦ Nodes inherit from abstract nodes
26
X3D Abstract Nodes All X3D abstract nodes begin with “x3d” ◦ X3DNode ◦ X3DChildNode ◦ X3DGroupingNode ◦ X3DGeometryNode ◦ X3DLightNode ◦ etc
27
Interface objects X3D specifies a number of abstract interfaces. Specifies some functionality that a node should implement. Examples: X3DBoundedObject X3DUrlObject H3DDisplayListObject
28
H3DLoad and H3DViewer Settings via H3DLoadSettings program H3DLoad – console H3DViewer – window application ◦ Settings for changing different options on the fly.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.