Virtual Reality Modeling Language 97
What’s VRML? Virtual Reality Modeling Language 2D/3D graphics Audio:.wav,.mid Video: MPEG-1 Interactivity: time- and action-based Hyperlinks Java VRML97 International Standard (IS) ISO/IEC :1997
Basic Concepts VRML File Structure Prototypes Scene Graph Event Routing A VRML browser
VRML File Structure A VRML file contains #VRML V2.0 utf8 # A sample VRML 97 file Prototypes Scene graph Event routing
Prototypes Provides a capability to extend VRML node types Can reuse defined nodes –e.g., defines different chairs, tables, etc.
Scene Graph A hierarchical structures for nodes Good for transformations Good for event generation and routing
Event Routing For interactivity User, time, or script triggered Routing path defined by authors –e.g., collide --> alarm --> crash -->...
A VRML Browser Parser prototypesbuilt-in nodes World routing pathscene graph Audio/Visual Presentation VRML file user input user
Node Reference (1) Group Nodes (2) Coordinates (3) Anchor (4) Sound (5) Sensor (6) Interpolator (7) Script
Group Nodes Transformations, events, etc. occur within a group Includes: Group: all children Transform: all children, new coordinate Switch: one child Group { children [ Shape { … }... ] }
Coordinates Transform { # X Y Z translation children [ Shape Cylinder { radius 1.0 height 1.0 }, ] }
Anchor A group node Select any child in the group jumps to a new VRML file Anchor { url "stairway.wrl" } description "Floating Stairs" children [... ] }
Sound AudioClip: signal source Sound: place to play Sound { source AudioClip { url "bach.wav" description ”music" loop TRUE startTime 1 stopTime 0 }, location minFront 10 minBack 10 maxFront 40 maxBack 40 spatialize TRUE },
Sensor Generated from depressed buttons, collision, timer, etc. Define a route path to trigger other nodes Each node has eventIn and eventOut interfaces AB out in
Interpolator PositionInterpolator { key [ 0.0, 0.5, 1.0 ] keyValue [ , , ] } Given a fraction [0..1], interpolate a new value –e.g., given > key = > keyValue = ( )/0.5*0.3 = 1.8, i.e., (1.8, 0.0, 0.0)
Script { field … eventIn …set_zzz eventOut … xxx_changed url "circle.class" or... url "circle.js" or... url "javascript:..." } Script Extend VRML’s capabilities to more complex objects/behaviors
References Official site: VRML repository: Industry: –vrml.sgi.com – –