Intro to VRML Let’s build something! The source code examples in this tutorial WORK!

Slides:



Advertisements
Similar presentations
Internet Basics & Way Beyond!
Advertisements

CREATED BY : VIRAL M.KORADIYA. Anchor elements are defined by the element. The element accepts several attributes, but either the Name or HREF attribute.
Sue Wills July Objects The JavaScript language is completely centered around objects, and because of this, it is known as an Object Oriented Programming.
Internet Services and Web Authoring (CSET 226) Lecture # 5 HyperText Markup Language (HTML) 1.
PHY-102 SAPIntroductory GraphicsSlide 1 Introductory Graphics In this section we will learn how about how to draw graphics on the screen in Java:  Drawing.
CSS Layout Crash Course An Advance CSS Tutorial. Inline vs. Block Many HTML elements have a default display setting of Block. Block elements take up the.
Cascading Style Sheets
Creating Pages in XHTML
INTRODUCTION TO HYPERTEXT MARKUP LANGUAGE 1. Outline  Introduction  Markup Languages  Editing HTML  Common Tags  Headers  Text Styling  Linking.
Chapter 5 Creating an Image Map.
Viewpoint { eventIn SFBool set_bind exposedField SFFloat fieldOfView # (0,  ) exposedField SFBool jump TRUE exposedField SFRotation orientation.
Introduction to VRML By Salman Yussof Diego Iglesias.
What Is VRML? VRML is: Stands for Virtual Reality Modeling Language A simple text language for describing 3-D shapes and interactive environments VRML.
© De Montfort University, D Graphics and VRML Howell Istance and Chris Hand* De Montfort University * now at
Graphics File Formats. 2 Graphics Data n Vector data –Lines –Polygons –Curves n Bitmap data –Array of pixels –Numerical values corresponding to gray-
A Standard Humanoid Representation on The Web: VRML/X3D Humanoid Animation Working Group (H-anim) Che-Jen Chen May/30/2003.
XP Creating Web Pages with HTML Using Tables. XP Objectives Create a text table Create a table using the,, and tags Create table headers and captions.
Cse591 Spring 981 VRML Basics The basic elements of VRML files are nodes. Every type of node has a set of fields associated with it. –Common single-valued.
Multimedia Web Components VRML. Introduction to VRML Case sensitive Most easy technique to provide interactive 3D environment in Web Required special.
Using HTML Tables.
Graphics in the web Digital Media: Communication and Design
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.
HTML: PART ONE. Creating an HTML Document  It is a good idea to plan out a web page before you start coding  Draw a planning sketch or create a sample.
Computer Sciences Department
Chapter 3 Adding Images in HTML. Agenda Understanding Web Page Images Prepare Your Images for the Web Insert an Image Specify an Image Size Add Alternative.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Fluency with Information Technology Third Edition by Lawrence Snyder Chapter.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 3 – Object Definition in VRML.
Shapes Properties Binding Chung Ji Hye.
VRML - 1 Virtual Reality Modeling Language (VRML) Peter O’Grady.
HTML (HyperText Markup Language)
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 26 – CheckWriter Application Introducing Graphics.
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.
1 Basic HTML. 2 Part 1: Basic Web Page Production.
C1999 Kathleen Schrock 1 Basic HTML By Kathy Schrock.
Department of Information Technology Chapter 8 - Creating Hypertext links Lecturer: Ms Melinda Chung.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
VRML Shapes and Geometry
1 Web Developer & Design Foundations with XHTML Chapter 4 Key Concepts.
CS105 INTRODUCTION TO COMPUTER CONCEPTS HTML Instructor: Cuong (Charlie) Pham.
1 Virtual Reality Modeling Language (VRML97) ©Anthony Steed
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 7 The Game Loop and Animation Starting Out with Games & Graphics.
Computer Graphics Group Script node Jiří Žára. Computer Graphics Group Contents 1.Script node 2.Motion generators 2Script node.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Adding Graphical Elements Essentials for.
CIS234A- Lecture 7 Instructor Greg D’Andrea. Tables A table can be displayed on a Web page either in a text or graphical format. A text table: – contains.
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.
H3D API Training Part 3.2: Fields; Event Handling.
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
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 2 – Basic VRML.
Paper 3 Unit 15 – Web Authoring Software Choices Graphics Exporting Graphics Creating CSS RGB Colour CSS – Body, Table and TD Border Collapse Tables -
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.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 6 – Texture Maps.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 5 – Animation in VRML.
© TMC Computer School HC20203 VRML HIGHER DIPLOMA IN COMPUTING Chapter 4 – Object Manipulation in VRML.
DLP for Virtual Environments (I)
Computação Gráfica VRML Rotação 07/12/2017.
translations, rotations, and reflections
CSS Layouts CH 13.
MPEG-4 Binary Information for Scenes (BIFS)
CSS Layouts: Grouping Elements
Department of Computer Science University College London
Objectives Create a figure box Add a background image
Tutorial Tutorial Read all the directions before proceeding
Putting Images on Your Web Page
VRML Shapes.
Lecture 3. Virtual Worlds : Representation,Creation and Simulation
Presentation transcript:

Intro to VRML Let’s build something! The source code examples in this tutorial WORK!

VRML File Structure Files start with a special comment –Gives version number, and character coding in the file #VRML V2.0 utf8 WorldInfo { title “This is an example” info ["(C) Copyright 2012 someone special"] } DEF FBOX Shape { appearance Appearance { material Material { } geometry Box { }

VRML File Structure World Info –Title of file, can be rendered by VRML viewers Objects –Contents of the world #VRML V2.0 utf8 WorldInfo { title “This is an example” info ["(C) Copyright 2012 someone special"] } DEF FBOX Shape { appearance Appearance { material Material { } geometry Box { }

Objects Shape { appearance Appearance { material Material { } geometry Box { } Shape node Shape node: A data structure containing two fields for describing an object. Causes a shape to be rendered. appearance field geometry field

Giving Objects Names DEF FBOX Shape { appearance Appearance { material Material { } geometry Box { } The shape object now has a name, FBOX. VRML is case sensitive.

Transformations Translation –Moving an object to a new (x, y, z) coordinate –In VRML, center of object is moved by adding x, y, z changes Rotation –Rotate object along one or more of the (x, y, z) coordinates by an amount of radians (an angle) Scaling –Alter size of an object in one of three possible ways: along the x-coordinate, the y-coordinate, and/or z-coordinate –In VRML, scaling is applied by giving three scale factors: (Sx, Sy, Sz) E.g., (2, 2, 2) will double the size of an object, where as (1, 2, 3) will leave the x-coordinate unchanged, double scale of the object along the y-coordinate dimension, and triple the size of the object along the z- coordinate dimension

Coordinate System

Transform Nodes Transform { scale rotation translation children [ USE FBOX ] } Transform node Transform node: A data structure giving rotations, translations, and scaling for an object. Operations carried out in sequence given, top to bottom. Transformations within a transform apply to the children of a node. Causes a transformed shape to be rendered. Scale by x=2, y= 0.5, z=2 Don’t change x-coord, subtract 1.5 from y, and don’t change z Rotate by.78 radians (45 degrees) along y coordinate

Example 2 #VRML V2.0 utf8 DEF FBOX Shape { appearance Appearance { material Material { } geometry Box { } Transform { scale rotation translation children [ USE FBOX ] } Transform adds a second object Places it below first one Applies the given changes to second object Transform node

Appearance nodes Can contain a material node or a texture node Material nodes can contain six fields: –diffuseColor: RGB color values, R, G, B between 0 and 1 normal color of object –specularColor: color values color of highlights on shiny objects –emissiveColor: color values object 'glows' with a light of its own of this color doesn't cast light on other objects –ambientIntensity: number between 0 and 1 amount of ambient light that object reflects –shininess: number between 0 and 1 How reflective the object is –transparency: number between 0 and 1 How transparent the object is Some VRML browsers will not support partly-transparent objects. DEF FBOX Shape { appearance Appearance { material Material { } geometry Box { }

Example Shape { appearance Appearance { material Material { emissiveColor transparency 0.5 } geometry Box { } Glowing transparent green Transparency of 1 means invisible; 0 means no transparency (default)

Texture nodes ImageTexture –Cover an object with a still image –Specified as a JPEG or PNG file MovieTexture –Texture-maps an MPEG file onto an object PixelTexture –Define your own textures via RGB or grayscale

#VRML V2.0 utf8 #brickwall.wrl # demonstrates use of textures Shape { appearance DEF theTexture Appearance { texture ImageTexture { url ["brick.jpg"] } # end texture } # end appearance geometry Box { size } # end geometry } # end shape

More on Geometry Nodes Box –Specified with X, Y, Z sizes Cylinder –Radius, height, and flags controlling rendering of ends, and side Sphere –Specified with radius Cone –Bottom radius, and height, and flags controlling rendering of bottom & side Text geometry Box { size } geometry Cylinder { radius 0.5 height 10 top FALSE } geometry Cone { bottomRadius 5 height 10 bottom FALSE } geometry Sphere { radius 10,000,000 }

Flags for cylinder There are also three other fields, side, top, and bottom. These are Boolean values (TRUE or FALSE), and tell the browser whether to display the appropriate section of the cylinder. These default to TRUE, so you don't need to put them in at all most of the time. However, if you had a cylinder where an end was obscured by another object, it would be worth turning off that end, as it will reduce the amount of work for the browser, speeding up the execution of your world.

Prototypes: More on Code Reuse So far, our statements have always resulted in rendered images in the VRML viewer It is useful to specify graphical procedures that just declare shapes, and don’t render them Parameters to these graphical procedures are also useful One way to create procedures in VRML is through the PROTO (prototype) statement

PROTO Syntax PROTO [ ## syntax: ## field ] { }

PROTO Parameter Types SFBool –This is a single boolean value, which can take the value "TRUE" or "FALSE". SFColor & MFColor –SFColor is a field containing a single color, made up of three floating-point numbers between 0 and 1 corresponding to the red, green and blue values of that color, e.g is green. MFColor is a field containing multiple colors, e.g. [0 1 0, 1 0 0, 0 0 1]. SFFloat & MFFloat –SFFloat is a single floating-point value, e.g And MFFloat is a number of floating- point values, e.g. [1.0, 3.4, 76.54]. SFImage –SFImage is a two-dimensional image, either in colour or grey. It consists of: Two integers, representing the width and height of the image. One integer representing the number of components in the image. 1 is grey levels only, 2 is grays with transparency, 3 is RGB color, and 4 is RGB with transparency. –After these, there are width * height hexadecimal numbers, consisting of 2 digits for each component. So, 0xFF would be white in a 1-component image, and 0xFF00007F would be half-transparent red in a 4-component image. –Pixels are specified from left to right, bottom to top. SFInt32 & MFInt32 –A single or list of 32-bit integer numbers. These can be in decimal or hexadecimal format. Hexadecimal numbers start with 0x, e.g. 0xFF is 255 in decimal.

PROTO Parameter Types SFNode & MFNode –SFNode is a single node, and MFNode is a list of nodes. Note that the children field in many nodes is of type MFNode. SFRotation & MFRotation –These fields specify a rotation about an axis. It is made up of four floating-point numbers. The first three specify X Y and Z coordinates for the vector corresponding to the axis about which to rotate, and the fourth is the number of radians to rotate by. SFString & MFString –This type contains a list of characters in the utf-8 character set. ASCII is a subset of utf-8, so you needn't worry about different character sets or anything. A string (SFString) is specified as "Hello", in double quotes. A list (MFString) looks like this: ["Hello", "World"]. SFTime & MFTime –A single or list of times. Times are specified as floating-point numbers representing the number of seconds elapsed since midnight on the 1st January This make more sense when we cover events later on. SFVec2f & MFVec2f –A single or list of 2D vectors. A 2D vector is a pair of floating-point numbers. SFVec3f & MFVec3f –A single or list of 3D vectors. A 3D vector is a triple of floating-point numbers.

Example Prototype: For Defining Graph Axes PROTO graphAxis [ field SFVec3f dimensions ] { Shape { appearance Appearance { material Material { } geometry Box { size IS dimensions } Defines a graphical procedure (prototype) called graphAxis Procedure has a formal parameter called dimensions, which is a vector of 3 floats Parameter used with “IS” syntax

Problem Define a prototype for a plot point with parameters for color and position

Solution PROTO plotPoint [ field SFVec3f position field SFColor color ] { Transform { translation IS position children [ Shape { appearance Appearance { material Material { diffuseColor IS color } geometry Sphere { radius.1 } } ] } }

Navigation Anchor { children [ USE HEAD ] description "Back to the ITU Home Page" url “ } Is supposed to work as in HTML

Practice Make a spaceship! Make a house? Something?