CVVR National Dong Hwa Univ. 國立東華大學 VRML Virtual Reality Modeling Language

Slides:



Advertisements
Similar presentations
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 10 VRML - An Introduction.
Advertisements

11.1 si31_2001 SI31 Advanced Computer Graphics AGR Lecture 11 VRML - An Introduction.
Internet Services and Web Authoring (CSET 226) Lecture # 5 HyperText Markup Language (HTML) 1.
1 Cascading Style Sheets Continued Different kinds of selectors in a style sheet –Simple- Pseudo-Class –Contextual- Pseudo-Element –Class Image Styles.
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
SE 313 – Computer Graphics Lecture 13: Lighting and Materials Practice Lecturer: Gazihan Alankuş 1.
Introduction to VRML By Salman Yussof Diego Iglesias.
Multimedia and the WWW Howell Istance and Chris Hand, Napier University.
© De Montfort University, D Graphics and VRML Howell Istance and Chris Hand* De Montfort University * now at
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Multimedia Web Components VRML. Introduction to VRML Case sensitive Most easy technique to provide interactive 3D environment in Web Required special.
Texture mapping. Adds realism to computer graphics Texture mapping applies a pattern of color Bump mapping alters the surface Mapping is cheaper than.
VRML Virtual Reality Modeling Language. What Are We Going to See? What is VRML? Syntax of the language Features Examples.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Guilford County Sci Vis V204.01
SET09115 Intro Graphics Programming
3D Concepts Coordinate Systems Coordinates specify points in space 3D coords commonly use X, Y, & Z A vertex is a 'corner' of an object Different coordinate.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
Lecture 5: 3D Rendering Pipeline (II) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
1 Perception and VR MONT 104S, Spring 2008 Lecture 22 Other Graphics Considerations Review.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 3 – Object Definition in VRML.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
Virtual reality. Tasks 3D digital model from planes 3D digital model of existing objects Office work Field observations Solid modeling Photogrammetry.
Shapes Properties Binding Chung Ji Hye.
CS324e - Elements of Graphics and Visualization Checkerboard World.
VRML - 1 Virtual Reality Modeling Language (VRML) Peter O’Grady.
I-1 Steps of Image Generation –Create a model of the objects –Create a model for the illumination of the objects –Create an image (render) the result I.
Textures and Maps MCC Computer Modelling Trimester 1 – 2015/2016.
VRML Shapes and Geometry
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
1 Virtual Reality Modeling Language (VRML97) ©Anthony Steed
Object Orientated Data Topic 5: Multimedia Technology.
Lecture 6: 3D graphics Concepts 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271 
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
H3D API Training Part 2.1: X3D. Outline  Scene graphs  X3D – XML syntax  X3D components overview.
CSE 381 – Advanced Game Programming GLSL Lighting.
Programming 3D Applications CE Displaying Computer Graphics Week 3 Lecture 5 Bob Hobbs Faculty of Computing, Engineering and Technology Staffordshire.
Game Programming 06 The Rendering Engine
VRML virtual reality modeling language. what is it? standardised (sort of) notation for virtual reality over the web text file (use normal text editor)
111/16/ :14 UML Instance Transformation x y z x y z x y z x y z SRT Model Coordinates.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Virtual Reality Modeling Language 97. What’s VRML? Virtual Reality Modeling Language 2D/3D graphics Audio:.wav,.mid Video: MPEG-1 Interactivity: time-
111/22/ :40 UML VRML 2.0 Scene Graph Structure Group Transformation Shape Nodes.
VRML Anthony Steed Department of Computer Science University College London ©Anthony Steed
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Illumination and Shading
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 2 – Basic VRML.
Course Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Applied Mathematics Lecture and laboratory.
Sky Boxes and Vector Math 2 Course Information CVG: Programming 4 My Name: Mark Walsh Website:
Intro to VRML Let’s build something! The source code examples in this tutorial WORK!
DESIGNING 3D WEB USING VRML Bob Hobbs Introduction to Virtual Reality and Simulation CE
Lighting a 3D Scene Guilford County Sci Vis V part 1.
1 9 Lighting a Scene v There are four types of lighting: –ambient light –directional light –point light –spotlight v Any number of these can be added to.
Local Illumination and Shading
Introduction to VRML for generating 3-D display
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 6 – Texture Maps.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 4 – Object Manipulation in VRML.
Computer Graphics: Illumination
Chapter 5. Lighting Computer Graphics (spring, 2009) School of Computer Science University of Seoul.
DLP for Virtual Environments (I)
MPEG-4 Binary Information for Scenes (BIFS)
Introduction to VRML for generating 3-D display
VRML Shapes.
Computer Graphics Material Colours and Lighting
Lecture 3. Virtual Worlds : Representation,Creation and Simulation
Presentation transcript:

CVVR National Dong Hwa Univ. 國立東華大學 VRML Virtual Reality Modeling Language

CVVR National Dong Hwa Univ. 國立東華大學 VRML In addition to HTML (HyperText Markup Language), that has become a standard authoring tool for the creation of home pages, VRML provides 3D worlds with integrated hyperlinks on the Web. Home pages become home spaces.

CVVR National Dong Hwa Univ. 國立東華大學 A text file format A simple language for describing 3-D shapes and interactive environments A web standard VRML is endorsed by most 3-D graphics vendors and most web browser vendors Virtual environments are realized by a player (browser) that interprets, executes, and presents VRML files 1. What is VRML

CVVR National Dong Hwa Univ. 國立東華大學 You can write VRML files using: Any text editor Many world builder applications You can view VRML files using: A VRML browser A VRML plug-in to an HTML browser such as Cortona Player or Cosmo Player Writing and Viewing VRML Files

CVVR National Dong Hwa Univ. 國立東華大學 VRML Example boink-penrose.wrl

CVVR National Dong Hwa Univ. 國立東華大學 VRML files contain: Header Comments - notes to yourself Nodes - nuggets of scene information Fields - node attributes you can change Field Values - attribute values Node Names - names for reusable nodes Nodes have field and field values that describe their attributes. Shape nodes are used to define shapes with appearance and geometry. VRML File Format

CVVR National Dong Hwa Univ. 國立東華大學 Nodes can be named, and used repeatedly DEF MyCylinder Shape {... }... USE MyCylinder... USE MyCylinder Defining Names for Nodes

CVVR National Dong Hwa Univ. 國立東華大學 Shapes are the building blocks of a VRML world Primitive Shapes are standard building blocks: Box Cone Cylinder Sphere Example: prim.wrl 2. Building Primitive Shapes

CVVR National Dong Hwa Univ. 國立東華大學 Understanding Shapes Shape nodes describe: geometry - form, or structure appearance - color and texture Shape { geometry... appearance... }

CVVR National Dong Hwa Univ. 國立東華大學 Shape geometry is built with geometry nodes Standard, primitive geometry nodes include: Box {... } Cone {... } Cylinder {... } Sphere {... } Specifying Geometry

CVVR National Dong Hwa Univ. 國立東華大學 Geometry node fields control dimensions Box { size } Cone { height 3.0 bottomRadius 0.75 } Cylinder { height 2.0 radius 1.5 } Sphere { radius 1.0 } Dimensions are usually in meters, but they can be anything Setting Geometry Dimension

CVVR National Dong Hwa Univ. 國立東華大學 #VRML V2.0 utf8 # A Cylinder Shape { appearance Appearance { material Material { } } geometry Cylinder { height 2.0 radius 1.5 } } Examples: cylinder.wrl A Sample Primitive Shapes

CVVR National Dong Hwa Univ. 國立東華大學 children - a list of member nodes for the group Group { children [ Shape {... }, Shape {... },... ] } Understanding Groups

CVVR National Dong Hwa Univ. 國立東華大學 A Sample Group Example: space.wrl

CVVR National Dong Hwa Univ. 國立東華大學 Text Shapes build text in a VRML world Signs, notes, annotation, control panels Text shapes are flat and have no thickness You can choose the font family, style, size, etc. 3. Building Text Shapes

CVVR National Dong Hwa Univ. 國立東華大學 Text geometry nodes describe: text strings - the text to build font style - how to build the text Shape { geometry Text { string... fontStyle... } Understanding Text

CVVR National Dong Hwa Univ. 國立東華大學 Text strings list the text to build Each string is built on its own line or column Text { string [ "SIGGRAPH 96", "Conference" ] } Building Text Strings

CVVR National Dong Hwa Univ. 國立東華大學 Font styles have: family - serif, sans, or typewriter style - bold, italic, both, or none size and spacing- character size and spacing FontStyle { family "SERIF" style "BOLD" size 1.0 spacing 1.0 } Specifying Font Style

CVVR National Dong Hwa Univ. 國立東華大學 Font styles also have: justification - begin, middle, end direction - left/right, up/down FontStyle { justify "BEGIN" horizontal TRUE leftToRight TRUE topToBottom TRUE } Specifying Font Direction

CVVR National Dong Hwa Univ. 國立東華大學 Shape {... geometry Text { string [ "SIGGRAPH 96", "Conference" ] fontStyle FontStyle { style "BOLD" } } Examples: sigtext.wrl A Sample Text Shape

CVVR National Dong Hwa Univ. 國立東華大學 4. Transform Shapes By default, all shapes are built at the center of the world A transform enables you to 1. Translate shapes 2. Rotate shapes 3. Scale shapes

CVVR National Dong Hwa Univ. 國立東華大學 A VRML file builds components for a world A file's world components are built in the file's world coordinate system Understanding Coordinate System

CVVR National Dong Hwa Univ. 國立東華大學  A transform creates a coordinate system that is translated, rotated, scaled relative to a parent coordinate system  Shapes built in the new coordinate system are translated, rotated, and scaled along with it Understanding Coordinate System Transform

CVVR National Dong Hwa Univ. 國立東華大學 A Transform group node controls: translation - position rotation - orientation scale - size Transform { translation... rotation... scale... children [... ] } Specifying Transform

CVVR National Dong Hwa Univ. 國立東華大學 Translating positions a coordinate system in X, Y, and Z Transform { # X Y Z translation children [... ] } Translating

CVVR National Dong Hwa Univ. 國立東華大學 Rotating orients a coordinate system about a rotation axis by a rotation angle Angles are measured in radians Transform { # X Y Z Angle rotation children [... ] } Rotating

CVVR National Dong Hwa Univ. 國立東華大學 A rotation axis defines a pole to rotate around Like the Earth's North-South pole Typical rotations are about the X, Y, or Z axes: Rotate about Axis X-Axis Y-Axis Z-Axis Understanding Rotating Axis

CVVR National Dong Hwa Univ. 國立東華大學 Using the Right Hand Rule

CVVR National Dong Hwa Univ. 國立東華大學 Scaling grows or shrinks a coordinate system by a scaling factor in X, Y, and Z Transform { # X Y Z scale children [... ] } Scaling

CVVR National Dong Hwa Univ. 國立東華大學 Scale, Rotate, and Translate a coordinate system, one after the other Transform { translation rotation scale children [... ] } Scaling, Rotating & Translating

CVVR National Dong Hwa Univ. 國立東華大學 Transform { translation rotation scale children [... ] } Examples: archs.wrl A Sample Transform Group

CVVR National Dong Hwa Univ. 國立東華大學 5. Controlling Appearance with Material The primitive shapes have a default emissive (glowing) white appearance You can control a shape's Shading color Glow color Transparency

CVVR National Dong Hwa Univ. 國立東華大學 The appearance of a surface is defined by setting properties that define the material from which it is made. A texture can also be defined to improve the appearance of a surface. material properties - color, transparency, etc. Shape { appearance Appearance { material... } geometry... } Understanding Appearance

CVVR National Dong Hwa Univ. 國立東華大學 A Material node controls: diffuse color - main shading color emissive color - glowing color transparency - opaque or not Material { diffuseColor... emissiveColor... transparency... } Understanding Materials

CVVR National Dong Hwa Univ. 國立東華大學 Three types of Material Reflection diffuseColor  Color of reflected light from diffuse reflection (light scattered randomly) ambientIntensity  Amount of background light the surface reflects specularColor  Color of reflected light from specular reflection (light reflected in a regular manner)

CVVR National Dong Hwa Univ. 國立東華大學 Colors specify: A mixture of red, green, and blue light Values between 0.0 (none) and 1.0 (lots) Color Red Green Blue White Black Yellow Magenta Brown Understanding Colors

CVVR National Dong Hwa Univ. 國立東華大學 Shape { appearance Appearance { material Material { diffuseColor } } geometry... } Example: slabs.wrl A Sample World using Appearance

CVVR National Dong Hwa Univ. 國立東華大學 Making a Shape Shining By specifying "high" values for the Material node's shininess field, direct light will cause a specular hilight (or shiny spot) on a shape By specifying a value for the Material node's specularColor field, you can control the color of specular hilights (or shiny spots) on a shape

CVVR National Dong Hwa Univ. 國立東華大學 A Sample of Shape Shining

CVVR National Dong Hwa Univ. 國立東華大學 6. Grouping Nodes Shapes can be grouped to compose more complex shapes VRML has several grouping nodes, including: Group {... } Switch {... } Transform {... } Billboard {... }

CVVR National Dong Hwa Univ. 國立東華大學 The Group node creates a basic group Every child node in the group is displayed Group { children [... ] } Understanding Basic Groups

CVVR National Dong Hwa Univ. 國立東華大學 The Transform group node creates a group with its own coordinate system Every child node in the group is displayed Transform { translation... rotation... scale... children [... ] } Understanding Transform Groups

CVVR National Dong Hwa Univ. 國立東華大學 The Switch group node creates a switched group Only one child node in the group is displayed You select which child Switch { whichChoice 0 choice [... ] } Understanding Switching Groups

CVVR National Dong Hwa Univ. 國立東華大學 The Billboard group node creates a group with a special coordinate system Every child node in the group is displayed Coordinate system is turned to face viewer Billboard { axisOfRotation... children [... ] } Understanding Billboard Groups

CVVR National Dong Hwa Univ. 國立東華大學 A rotation axis defines a pole to rotate round Similar to a Transform node's rotation field, but no angle (auto computed) Billboard Rotation Axes

CVVR National Dong Hwa Univ. 國立東華大學 Group { children [ Billboard { axisOfRotation children [... ] }, Transform {... } ] } Example: robobill.wrl A Sample Billboard Group

CVVR National Dong Hwa Univ. 國立東華大學 Inlining World Components VRML files describe components of a world: tables, chairs, lamps, walls, floors, doors Inlining combines files to build larger components: rooms, buildings, neighborhoods

CVVR National Dong Hwa Univ. 國立東華大學 The Inline node creates a special group Children are read from a VRML file selected by a URL Every child node in the group is displayed Inline { url "table.wrl" } Understanding Inlining

CVVR National Dong Hwa Univ. 國立東華大學... Inline { url "table.wrl" },... Transform { translation... children [ Inline { url "chair.wrl" } ] },... Example: dinette.wrl A Sample Inlined File

CVVR National Dong Hwa Univ. 國立東華大學 Adding Anchors to Your World Any shape or group of shapes can be an anchor Selecting the anchor jumps to a new VRML world Like the syntax of HTML

CVVR National Dong Hwa Univ. 國立東華大學 The Anchor node creates a group Every child node in the group is displayed Selecting any child jumps to VRML file specified by URL The anchor can have a description string Understanding Anchors

CVVR National Dong Hwa Univ. 國立東華大學 A Sample Anchor Anchor { url "stairway.wrl" description "Floating Stairs" children [... ] } Example: anchor.wrl

CVVR National Dong Hwa Univ. 國立東華大學 7. Coordinate based Geometry: Points, Lines, and Faces Create more complex shapes than primitives Generate more efficient VRML worlds Have more control and flexibility than primitives

CVVR National Dong Hwa Univ. 國立東華大學 Hard to build using primitives There's a more flexible way to describe shapes...

CVVR National Dong Hwa Univ. 國立東華大學 (1) Specifying Coordinates (Define location of "dots “ ) Location of dots (points) using Coordinate node Coordinate { point [ , ,... ] } (2) Creating Geometry Using Coordinates (Connect the dots ) Three nodes have a coord field which accepts a Coordinate node PointSet IndexedLineSet IndexedFaceSet Describe Geometry in two steps

CVVR National Dong Hwa Univ. 國立東華大學 PointSet Node A dot is drawn at each point PointSet { coord Coordinate { point [... ] } color Color { color [... ] } } No control over size of dot Also supports color field for Color node Example: ptplot.wrl

CVVR National Dong Hwa Univ. 國立東華大學 Straight lines are drawn between points IndexedLineSet { coord Coordinate { point [... ] } coordIndex [ 1, 0, 3, -1,... ] } Example: lnplot.wrl IndexedLineSet Node

CVVR National Dong Hwa Univ. 國立東華大學 coordIndex [ 1, 0, 3, -1,... ] Indexes reference ordered points of coord field Index order is arbitrary (eg: 1, 0) Indexes are Zero-based (eg: 0) Can skip coordinates (eg: 0, 3) Poly-line can be many points (eg: 1, 0, 3) End of poly-line (eg: -1) Multiple poly-lines (eg:...) CoordIndex Value

CVVR National Dong Hwa Univ. 國立東華大學 IndexedFaceSet Node Faces are drawn within perimeter of points IndexedFaceSet { coord Coordinate { point [... ] } coordIndex [ 1, 0, 3, -1,... ] } Example: vase1.wrl

CVVR National Dong Hwa Univ. 國立東華大學 8. Binding Color to Coordinate based Geometry Override Material node (overall color) Better color control for IndexedFaceSet, IndexedLineSet, PointSet, and ElevationGrid nodes Apply color per-face or per-vertex

CVVR National Dong Hwa Univ. 國立東華大學 The Color node is used as the color field value of IndexedFaceSet, IndexedLineSet, PointSet or ElevationGrid nodes The Color node contains a list of RGB values Color { color [ ,... ] } Color Node

CVVR National Dong Hwa Univ. 國立東華大學 IndexedFaceSet { coord Coordinate {... } coordIndex [... ] color Color { color [ ,... ] } colorIndex [ 3, 0, 1,... ] colorPerVertex TRUE } IndexedFaceSet using a color node

CVVR National Dong Hwa Univ. 國立東華大學 In IndexedFaceSet, IndexedLineSet nodes When colorPerVertex is TRUE, specify one color index per coordinate index (don't forget to account for the - 1's !) When colorPerVertex is FALSE, specify one color index per face or line (eg. per -1) ColorPerVertexField

CVVR National Dong Hwa Univ. 國立東華大學 Colored triangles: per-face and per-vertex Example: color_face.wrl, color_vertex.wrl A sample Color Binding

CVVR National Dong Hwa Univ. 國立東華大學 9. Mapping Texture Wrap images around shapes Apply an image as an opaque "decal" Apply an image with transparent "holes" Wrap a movie's images around shapes Add realistic appearance to shapes

CVVR National Dong Hwa Univ. 國立東華大學 Texture color overrides Material node color Appearance node's texture field wraps an image around geometry The texture can be an ImageTexture, MovieTexture, or PixelTexture Texture Property

CVVR National Dong Hwa Univ. 國立東華大學 Appearance { material Material {} texture ImageTexture { url "myimage.jpg" } } ImageTexture Node

CVVR National Dong Hwa Univ. 國立東華大學 Appearance { texture MovieTexture { url "mymovie.mpg" speed 1 loop FALSE } } MovieTexture Node

CVVR National Dong Hwa Univ. 國立東華大學 The PixelTexture node contains data stored as width, height, number of channels, followed by width*height hex values representing the image Example: A 2x4 RGB image PixelTexture { image xFF0000 0x00FF xFFFFFF 0xFFFF00 } PixelTexture Node

CVVR National Dong Hwa Univ. 國立東華大學 A sample Texture Mapping Example: can.wrl

CVVR National Dong Hwa Univ. 國立東華大學 10. Texture Control When applying a texture, you sometimes need to control: What piece of a texture is extracted from an image How the piece of texture is applied to a face

CVVR National Dong Hwa Univ. 國立東華大學 I. Build cookie cutter of desired size and shape II. Set position, rotation and scale over sheet III. Extract a piece of dough from sheet, and apply extracted piece of dough onto shape Three steps to apply a piece of texture

CVVR National Dong Hwa Univ. 國立東華大學 texCoord TextureCoordinate { point [ , , , ] } Note: texCoord is a field of IndexedFaceSet, ElevationGrid nodes I. Build Cookie Cutter Shape

CVVR National Dong Hwa Univ. 國立東華大學 Appearance node's textureTransform field sets position, rotation and scale of cutter over the dough TextureTransform { translation rotation 0.0 scale } II. Texture Transform

CVVR National Dong Hwa Univ. 國立東華大學 IndexedFaceSet extracts and applies the piece of texture to faces IndexedFaceSet { coord Coordinate {... } coordIndex [... ] texCoord TextureCoordinate {... } texCoordIndex [... ] } III. Extract and Apply Texture

CVVR National Dong Hwa Univ. 國立東華大學 Texture Transform: Scale TextureTransform { scale }

CVVR National Dong Hwa Univ. 國立東華大學 Texture Transform: Transform TextureTransform { translation } # 1/6

CVVR National Dong Hwa Univ. 國立東華大學 Texture Transform: Rotation TextureTransform { rotation # 45 degrees }

CVVR National Dong Hwa Univ. 國立東華大學 11. Shading Control using Normals Normals define the direction of faces Faces used to approximate smooth surfaces, but normals can be used to control whether a surface is flat or smoothly shaded Default Normals are often good enough !

CVVR National Dong Hwa Univ. 國立東華大學 To control shading of ElevationGrid, and IndexedFaceSet nodes Specify normal, normalIndex, and normalPerVertex field values or … Set the creaseAngle field to automatically generate normals Shading Control Tools

CVVR National Dong Hwa Univ. 國立東華大學 The normal field specifies face direction Normal { vector [ , , ,... ] } Normal Node

CVVR National Dong Hwa Univ. 國立東華大學 CreaseAngle Field If angle between adjacent faces is larger than creaseAngle, then faces are flat shaded. If angle between adjacent faces is smaller than creaseAngle, then faces are smoothly shaded.

CVVR National Dong Hwa Univ. 國立東華大學 Shading Flat Surface colored uniformly according to its orientation towards light sources Faceted appearance Smooth (Gouraud) Each vertex is assigned a color according to its orientation towards light sources and intermediate points are a blend of the surrounding vertex colors Smooth shading Can be too smooth (can smooth away detail)

CVVR National Dong Hwa Univ. 國立東華大學 12. Lights Light sources illuminate and effect shading of faces Several types of lights available for maximum control Lights do not cast shadows

CVVR National Dong Hwa Univ. 國立東華大學 Three different light nodes PointLight, DirectionalLight, SpotLight Standard fields (common to all 3) and defaults: on TRUE intensity 1.0 ambientIntensity 0.0 color Light Node

CVVR National Dong Hwa Univ. 國立東華大學 Point lights have a location and glow radially PointLight { # Standard fields, plus: location radius 1.0 # specifies the maximum distance for the light rays to travel attenuation } PointLight Node

CVVR National Dong Hwa Univ. 國立東華大學 Directional lights point in a specified direction DirectionalLight { # Standard fields, plus: direction } Directional Light

CVVR National Dong Hwa Univ. 國立東華大學 Spot lights point in a direction and focus in a cone SpotLight { # Standard fields, plus: location direction cutOffAngle radius 1.0 attenuation } Spot Light

CVVR National Dong Hwa Univ. 國立東華大學 Backgrounds add realism to VRML worlds Backgrounds are cheaper than using geometry Backgrounds always stay "infinitely distant" 13. Background

CVVR National Dong Hwa Univ. 國立東華大學 Two types of background (can be combined) Backdrop: Sky and Ground color gradients (Mapped to inside of a sphere) Panorama: Surrounding images (Mapped to inside faces of a cube) Backdrop vs. Panorama

CVVR National Dong Hwa Univ. 國立東華大學 xxxColor specifies color values xxxAngle specifies angles in radians (0.. PI) Background { groundColor [ , , 0, 0, 0 ] groundAngle [.785, 1.57 ] skyColor [ , , 0, 0, 0 ] skyAngle [.785, 1.57 ] } Example: m_bkgd1.wrl Specifying Backdrop

CVVR National Dong Hwa Univ. 國立東華大學 Specifying Panorama xxxUrl fields specify images Images overlay backdrop (if any) (backdrop shows through transparent regions) Background { frontUrl "f_image.jpg" backUrl "b_image.jpg" leftUrl "l_image.jpg" rightUrl "r_image.jpg" } Example: m_bkgd2.wrl

CVVR National Dong Hwa Univ. 國立東華大學 Fog is a "special effect" for added realism Exact effects (if any) are browser dependent Colors "fade" to a specified value over distance 14. Fog

CVVR National Dong Hwa Univ. 國立東華大學 VRML Fog Example #VRML V2.0 utf8 Group { children [... Fog { color fogType "EXPONENTIAL" visibilityRange 30.0 } ] } Fog Node

CVVR National Dong Hwa Univ. 國立東華大學 Fog can be used to provide a depth cue, add atmosphere, and increase realism Colors fade to value specified in color field. visibilityRange specifies distance at which fog color predominates. Value 0 disables node. Example: fog1.wrl, fog2.wrl, fog4.wrl Fog Example

CVVR National Dong Hwa Univ. 國立東華大學 15. Level of Detail LOD (Level Of Detail): Can reduce "upfront" download time (have simpler models loaded first) Can improve frame rate (use simpler models for far away objects) Useful as a depth cue

CVVR National Dong Hwa Univ. 國立東華大學 An object is rendered with more detail when a user is close to it than when the user is far away An object can have several levels of detail, each valid for a different range of distances Hardware assist the transition between levels of detail to make them as smooth as possible Levels of Detail

CVVR National Dong Hwa Univ. 國立東華大學 Range specifies distance from center of LOD to viewer (for each transition between levels) Grouping node (one child displayed at a time). LOD { range [... ] center level [... ] } LOD Node

CVVR National Dong Hwa Univ. 國立東華大學 Using Ranges List range values in increasing order. Define children in order of highest to lowest detail. For N ranges, provide N+1 children range [ 20, 100 ] < 20 m 1st child used >= 20 & < 100 m 2nd child used >= 100 m 3rd child used Example: m_lod1.wrl, m_lod2.wrl

CVVR National Dong Hwa Univ. 國立東華大學 Making good levels of detail is tricky. Two or three levels are usually enough. Remove "details" that are easy to remove Simplify geometry if appropriate Everything is a hint! (Browser decides which level to display.) LOD can get large, use Inline for some kids. Don't use LOD to simulate behavior. center is not a translation. Optimizing Strategy

CVVR National Dong Hwa Univ. 國立東華大學 Primarily used to define named camera positions Browser will usually present a list of viewpoints using their description strings. Browser may animate between viewpoints. 16. Controlling the View Point

CVVR National Dong Hwa Univ. 國立東華大學 Using Viewpoint Orientation defines direction of view and "up" direction (relative to default orientation).  Rotation Viewpoint { position orientation description "DefaultView" } Example:m_vwpts1.wrl

CVVR National Dong Hwa Univ. 國立東華大學 Sound adds realism and allows special effects General uses: 1. Continuous background (traffic, muzak,...) 2. Continuous localized (waterfall, monster,...) 3. Triggered (bumping wall, clicking switch,...) 17. Adding Sound

CVVR National Dong Hwa Univ. 國立東華大學 A Signal AudioClip or MovieTexture Node Think of this as the "CD player" A Location Sound Node Think of this as the "speaker" CD Player vs. Speaker

CVVR National Dong Hwa Univ. 國立東華大學 AudioClip specifies a signal Typically.wav or.mid file Start time, pitch, looping or not Sound specifies a place Location, direction, attenuation region Intensity, "spatialized" or not AudioClip vs. Sound

CVVR National Dong Hwa Univ. 國立東華大學 Playback started by: Setting startTime field Setting loop to TRUE AudioClip { url [... ] loop FALSE startTime 0 } AudioClip Node

CVVR National Dong Hwa Univ. 國立東華大學 Audible if clip is playing and node is "traversed" Sound { source AudioClip {... } intensity 1 location direction spatialize TRUE } Basic Sound Node

CVVR National Dong Hwa Univ. 國立東華大學 Advanced Sound Node Defines two ellipsoids aligned with direction Full intensity within inner ellipsoid Intensity drops to zero between inner and outer Sound {... minFront 1 maxFront 10 minBack 1 maxBack 10 }

CVVR National Dong Hwa Univ. 國立東華大學

In AudioClip node set loop field to TRUE (Will start on entering world) In Sound node set minFront and minBack to large values. spatialize to FALSE (stereo clip will play as stereo) Example: m_sound1.wrl Continuous Background Sound

CVVR National Dong Hwa Univ. 國立東華大學 Set AudioClip node same as previous. In Sound node set position and direction minFront, maxFront,... values spatialize to TRUE (clip will play as monaural) Example: m_sound2.wrl Continuous Localized Sound

CVVR National Dong Hwa Univ. 國立東華大學 In AudioClip node set loop field to FALSE (for a "one shot") startTime each time sound should play (discussed later) In Sound node set location, direction,... spatialize to TRUE (usually) Example: m_sound3.wrl Triggered Sound

CVVR National Dong Hwa Univ. 國立東華大學 18. Fields and Events Each node has specific fields and events 1.Field: A stored value (parameter), eg. url 2.EventIn: An event node can receive, eg. set_url 3.EventOut : An event node can send, eg. url_changed Event: A message that contains a data value

CVVR National Dong Hwa Univ. 國立東華大學 Routes Route: Connects an EventOut to an EventIn A Route is not a node! Output type must match input type exactly Output may connect to multiple inputs (fan-out) Multiple outputs may connect to single input (fan-in) Nodes must be named in order to use Routes

CVVR National Dong Hwa Univ. 國立東華大學 DEF NODE1 Collision {... } DEF NODE2 AudioClip {... } ROUTE NODE1.CollideTime TO NODE2.startTime Example: m_route.wrl Route Example