1 Virtual Reality Modeling Language (VRML97) ©Anthony Steed 1998-2005.

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.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Exploring JavaFX 3D Jim Weaver Java Technology Ambassador
Lighting and Illumination Lighting is the major problem in computer graphics, for either realism or real-time compositions- harder than modeling Consider.
© Richard Jones, 2009 CO641 Computer Graphics 1 CO641 Computer Graphics and Animation X3d / VRML Richard Jones SW107
18.1 Si31_2001 SI31 Advanced Computer Graphics AGR Lecture 18 Image-based Rendering Light Maps What We Did Not Cover Learning More...
Introduction to VRML By Salman Yussof Diego Iglesias.
Virtual reality interfaces in connection with building process simulations. Prof. Nash Dawood Centre for Construction Innovation Research University of.
Multimedia and the WWW Howell Istance and Chris Hand, Napier University.
An Overview of VRML §Scene Graph Structure VRML files describe 3D objects and worlds using a hierarchical scene graph. Entities in the scene graph are.
© De Montfort University, D Graphics and VRML Howell Istance and Chris Hand* De Montfort University * now at
Multimedia Web Components VRML. Introduction to VRML Case sensitive Most easy technique to provide interactive 3D environment in Web Required special.
VRML Virtual Reality Modeling Language. What Are We Going to See? What is VRML? Syntax of the language Features Examples.
Scenes, Cameras & Lighting. Outline  Constructing a scene  Using hierarchy  Camera models  Light models.
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.
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.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
1 Basic Modelling. 2 Lecture Objectives n To understand how 3D scenes can be modelled - in terms of geometry, appearance and behaviour - and rendered.
© 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.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
COMP 175: Computer Graphics March 24, 2015
Virtual reality. Tasks 3D digital model from planes 3D digital model of existing objects Office work Field observations Solid modeling Photogrammetry.
VRML Dr. Alun Moon What is VRML The Virtual Reality Modeling Language (VRML) is a file format for describing interactive 3D objects.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Shapes Properties Binding Chung Ji Hye.
CS324e - Elements of Graphics and Visualization Checkerboard World.
VRML - 1 Virtual Reality Modeling Language (VRML) Peter O’Grady.
3D Objects Subject:T0934 / Multimedia Programming Foundation Session:12 Tahun:2009 Versi:1/0.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
VRML Shapes and Geometry
VRML Scene Graphs. Learning Objectives Understand the concept of a scene graph Understand how VRML defines transformations (translations, rotations, and.
History of VRML and Its Development Process. Learning Objectives Understand the history of VRML Understand the purpose and functions of VRML Learn how.
CVVR National Dong Hwa Univ. 國立東華大學 VRML Virtual Reality Modeling Language
Computer Graphics Group Script node Jiří Žára. Computer Graphics Group Contents 1.Script node 2.Motion generators 2Script node.
H3D API Training Part 2.1: X3D. Outline  Scene graphs  X3D – XML syntax  X3D components overview.
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.
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.
A Few Things about Graphics Jian Huang Computer Science University of Tennessee.
© 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.
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
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 9 Lighting and Texturing.
Web3D Jyun-Ming Chen Fall Contents Definitions, components Examples Task breakdown Survey of available technologies Recommended platform Details.
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.
Zhang & Liang, Computer Graphics Using Java 2D and 3D (c) 2007 Pearson Education, Inc. All rights reserved. 1 Chapter 11 Animation.
Local Illumination and Shading
Introduction to VRML for generating 3-D display
1 Perception and VR MONT 104S, Fall 2008 Lecture 20 Computer Graphics and VR.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 6 – Texture Maps.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 4 – Object Manipulation in VRML.
Illumination Models and Surface-Rendering Methods CEng 477 Introduction to Computer Graphics.
DLP for Virtual Environments (I)
MPEG-4 Binary Information for Scenes (BIFS)
Department of Computer Science University College London
VIRTUAL REALITY IN ROBOTICS
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:

1 Virtual Reality Modeling Language (VRML97) ©Anthony Steed

2 Introduction to VRML n Virtual Reality Modelling Language A file format to describe 3D scenes –identified by “.wrl” extension Also a description of a run-time system for animating worlds Designed to be used in network situations Supports interaction and simulation of behaviour of objects Designed to run on desktop PCs through to high- end workstations MIME type is model/vrml

3 VRML Basics n VRML file contains Nodes that describe the scene n A Node is defined with several Fields Each line give the field, the type of the field, the name and the default value. n Example Node specification Cone { field SFFloat bottomRadius 1 field SFFloat height 2 field SFBool side TRUE field SFBool bottom TRUE }

4 Sample VRML File “example1.wrl” #VRML V2.0 utf8 Transform { children [ Shape { appearance Appearance { material Material { diffuseColor } geometry Sphere { radius 2 } } ] } Every VRML97 file starts #VRML V2.0 utf8

5 Classes of Node n Shapes Geometry Appearance n Transformations n Lights n Groups

6 Shapes n Each Shape has a geometry field that contains a geometry node and an appearance field that contains an Appearance node Shape { appearance geometry } n Example (from example1.wrl) Shape { appearance Appearance { material Material { diffuseColor } geometry Sphere { radius 2 }

7 Geometry Nodes n Basic types Box Sphere Cylinder Cone Text n Box defined by its size field Box { size } n Sphere defined by its radius field Sphere { radius 1.5 }

8 Geometry Nodes n Cylinder defined by its height and radius fields Cylinder { height 2.0 radius 1.0 } n Cone defined by its height and radius fields Cone { radius 1.3 height 1.8 } n Text defined by the string and the font geometry Text { string ["Hi!"] fontStyle FontStyle { family "TYPEWRITER" style "ITALIC" }

9 Complex Geometry n Many objects can not be described with standard solids n General geometry described with IndexedFaceSet, IndexedLineSet, PointSet, ElevationGrid, Extrusion n Each uses some of the following nodes in definition Coordinate, Normal, Color, TextureCoordinate

10 PointSet n Define a set of points and the colour of each point geometry PointSet { color Color { color [1 1 1, 1 1 1, 1 1 1, 1 1 1, 1 1 1, 1 1 1, 1 1 1, 1 1 1, 1 1 1, 1 1 1, 1 1 1, 1 1 1] } coord DEF COORDS Coordinate { point [ 1 0 0, , 0 0 1, , , 2 1 0, , , , 0 1 2, , ] } }

IndexedFaceSet IndexedFaceSet { eventIn MFInt32 set_colorIndex eventIn MFInt32 set_coordIndex eventIn MFInt32 set_normalIndex eventIn MFInt32 set_texCoordIndex exposedField SFNode color NULL exposedField SFNode coord NULL exposedField SFNode normal NULL exposedField SFNode texCoord NULL field SFBool ccw TRUE field MFInt32 colorIndex [] field SFBool colorPerVertex TRUE field SFBool convex TRUE field MFInt32 coordIndex [] field SFFloat creaseAngle 0 field MFInt32 normalIndex [] field SFBool normalPerVertex TRUE field SFBool solid TRUE field MFInt32 texCoordIndex [] }

12 IndexedFaceSet n Components the points to construct the face from the normals to give at the points the colours of the points the texture coordinates of the points n Can define normals and colours for each vertex or each face n Texture coordinate defined at each vertex Hints each face is “convex” the faces are defined in counter-clockwise order the object is solid (i.e. each triangle is one-sided)

13 IndexedFaceSet n Coordinate n Define faces using list of vertices each terminated by -1 geometry IndexedFaceSet { coord USE COORDS coordIndex [ 0, 2, 9, 5, 0, -1, 3, 0, 5, 11, 3, -1, 1, 3, 11, 7, 1, -1, 2, 1, 7, 9, 2, -1 0, 3, 10,4, 0, -1, 3, 1, 6, 10, 3, -1, 2, 8, 6, 1, 2, -1, 2, 0, 4, 8, 2, -1, 9, 8, 4, 5, 9, -1, 5, 4, 10, 11, 5, -1, 11, 10, 6, 7, 11, -1, 7, 6, 8, 9, 7, -1 ] }

14 IndexedFaceSet n Colour per face color Color { color [ 1 1 1, ]} colorPerVertex FALSE colorIndex [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1] n Colour per vertex color Color { color [ 1 1 1, ]} colorPerVertex TRUE colorIndex [ 0, 1, 1, 0, 0, -1, 1, 0, 0, 1, 1, -1, 0, 1, 1, 0, 0, -1, 1, 0, 0, 1, 1, -1 0, 1, 1,0, 0, -1, 1, 0, 0, 1, 1, -1, 0, 1, 1,0, 0, -1, 1, 0, 0, 1, 1, -1 ] 12 colours = 1 per face 72 indices = 1 for each vertex in the face set definition

15 IndexedFaceSet n Normal defines the direction of each point and the way it reflects light default normal is perpendicular to surface of polygon polygon is flat if all normals point same way otherwise smooth interpolation normal Normal { vector [ , 1 0 1, , , 1 0 0, , 0 0 1, ] } normalPerVertex TRUE normalIndex [ 5, 7, 7, 5, 5, -1, 6, 5, 5, 6, 6, -1, 4, 6, 6, 4, 4, -1, 7, 4, 4, 7, 7, -1 5, 6, 6,5, 5, -1, 6, 4, 4, 6, 6, -1, 7, 7, 4, 4, 7, -1, 7, 5, 5, 7, 7, -1, 1, 1, 1, 1, 1, -1, 2, 2, 2,2, 2, -1, 0, 0, 0, 0, 0, -1, 3, 3, 3, 3, 3, -1 ]

16 IndexedFaceSet n Texture Coordinates specify the position on the texture map of each point on the shape fractional points are allowed measure from bottom left of image n Ugly example: texCoord TextureCoordinate { point [ 0 0, 0 1, 1 1, 1 0 ] } texCoordIndex [ 0, 1, 2, 3, 0, -1, 0, 1, 2, 3, 0, -1, 0, 1, 2, 3, 0, -1, 0, 1, 2, 3, 0, -1 ]

17 IndexedLineSet n Defines a line set n Colour per line or per vertex geometry IndexedLineSet { coord USE COORDS coordIndex [ 0, 4, 5, 0, -1, 3, 10, 11, 3, -1, 1, 6, 7, 1, -1, 2, 8, 9, 2, -1, 0, 2, 1, 3, 0, -1, 4, 8, 6, 10, 4, -1, 5, 9, 7, 11, 5, -1] color Color { color 1 1 1} colorPerVertex FALSE colorIndex [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }

18 Transformations n Define the positions of objects in 3D space n XY are the plane of the screen n Z is towards the Viewer n Transformation basically contains rotation scale translation a set of children nodes n Rotations follow “right-hand screw rule” X Z Y

19 Effects of Transformation n translation Transform { translation children [ … ]} n rotation translation rotation n scale translation rotation scale

20 Scene Graph n Transforms are hierarchical forms a directed acyclic graph Transform { translation children [ Shape { } Transform { translation children [ Shape { } Transform { translation children [ Shape { } ] } ] } ] }

21 Transform Hierarchy Example Transformation Box Transformation Box

22 Node Re-Use n Objects can be re-used using DEF/USE pairs n DEF a name for a node when it is first being decsribed USE a node whenever a node of that type is required I.E. if you DEF an Appearance node then USE of that node must be in a place that is valid for an Appearance node to be DEF UCL_BOX Shape { appearance Appearance { texture ImageTexture { url ["logo.jpeg"] } geometry Box { size }

23 DEF/USE Example #VRML V2.0 utf8 Transform { translation children [ DEF UCL_BOX Shape { appearance Appearance { texture ImageTexture { url ["logo.jpeg"] } geometry Box { size } ] } Transform { translation children [ USE UCL_BOX ] }

24 Appearance n Defines the look of some piece of geometry Material –combination of ambient colour, diffuse colour, emmisive colour,shinines, transparency, specular colour Texture –defines a picture to paste to the object fetch from a URL supports movies TextureTransform –defines how the picture is applied to the object

25 Material Examples n Material Shiny Material ambientIntensity 0.3 diffuseColor specularColor shininess 0.6 Dull Material ambientIntensity 0.1 diffuseColor shininess 0.0 Transparent Material diffuseColor transparency 0.5 Colour components defined in RGB (red, green, blue triplets)

26 Lights n Provide illumination in the scene DirectionalLight PointLight SpotLight n DirectionalLight light rays travelling in parallel lines e.g. sunlight DirectionalLight { direction intensity 0.8 }

27 Lights n PointLight radiate in all directions n SpotLight radiate only in certain directions, and with volumes of different intensity n SpotLight and PointLight “attenuate” - their effect can decrease over distance

28 Other Things … n Interaction n Scripting Java JavaScript n Interpolators n Sensors n Fog n Background n Audio n Video n LOD n Billboard

29 LOD n Switches between two or more views depending on distance n Nearby View Bunny1 = ~56K polygons n Distant View Bunny2= ~1K polygons

30 Billboards n Billboards object always faces the viewer Transform { translation children [ Billboard { children [ USE UCL_BOX ] } ] }

31 Summary n VRML97 provides a simply file format to put 3D objects on the web n Animation and scripting are allowed, but we haven’t discussed these n Somewhat restricted model of local lighting compared to today’s graphics cards