VRML Anthony Steed Department of Computer Science University College London ©Anthony Steed 1998-2001.

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.
3D Graphics Rendering and Terrain Modeling
© Richard Jones, 2009 CO641 Computer Graphics 1 CO641 Computer Graphics and Animation X3d / VRML Richard Jones SW107
Introduction to VRML By Salman Yussof Diego Iglesias.
(conventional Cartesian reference system)
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.
3D Rendering with JOGL Introduction to Java OpenGL Graphic Library By Ricardo Veguilla
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.
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.
1 Virtual Reality Modeling Language (VRML97) ©Anthony Steed
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
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.
Copyright © Curt Hill Visualization of 3D Worlds How are these images described?
Game Programming 06 The Rendering Engine
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
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.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
© 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.
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.
Mohammed AM Dwikat CIS Department Digital Image.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
© 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
3D Graphics Rendering PPT By Ricardo Veguilla.
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:

VRML Anthony Steed Department of Computer Science University College London ©Anthony Steed

Introduction to VRML 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 Integration with web browsers Can embed VRML in HTML documents –Supports interaction and simulation of behaviour of objects 3D hyperlinks Movement about scene –Designed to run on desktop PCs through to high-end workstations –MIME type is model/vrml

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

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

Classes of Node Shapes –Geometry –Appearance Transformations Lights Groups

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

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

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

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

PointSet 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 Most commonly used geometry node Complex definition 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 [] }

IndexedFaceSet 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 Can define normals and colours –for each vertex or each face Texture coordinate defined at each vertex (since they are usually different!) Hints –each face is “convex” –the faces are defined in counter- clockwise order –the object is solid (i.e. each triangle is one-sided)

IndexedFaceSet Coordinate 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 ] }

IndexedFaceSet Colours –colour per face color Color { color [ 1 1 1, ]} colorPerVertex FALSE colorIndex [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1] –OR 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

IndexedFaceSet 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 –Each smooth shading 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 ]

IndexedFaceSet 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 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 ]

IndexedLineSet Defines a line set 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] }

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

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

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

Transform Hierarchy Example Transformation Box Transformation Box

Node Re-Use Objects can be re-used using DEF/USE pairs DEF a name for a node when it is first being decsribed DEF UCL_BOX Shape { appearance Appearance { texture ImageTexture { url ["logo.jpeg"] } geometry Box { size } 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/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 ] }

Appearance 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

Material Examples 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)

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

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

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

LOD Nearby View Distant View Bunny1 = ~56K polygons Bunny2= ~1K polygons

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