1 / 44

VRML

VRML. Virtual Reality Modeling Language. What Are We Going to See?. What is VRML? Syntax of the language Features Examples. Credits. Most of the demos Are based on demos from “Floppy's VRML Guide - VRML97 Tutorial”

ron
Download Presentation

VRML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. VRML Virtual Reality Modeling Language

  2. What Are We Going to See? • What is VRML? • Syntax of the language • Features • Examples

  3. Credits Most of the demos Are based on demos from “Floppy's VRML Guide - VRML97 Tutorial” The demos are localy saved to increase efficiency end accessibility. The originals and many more can be found in : http://www.vapourtech.com/vrmlguide

  4. A Bit Of History • In the beginning there was VRML 1.0. • It was the first attempt at an internet 3D language. • VRML 2.0 replaced VRML 1.0 and add many features (animation). • Version 2.0 was submitted to ISO for standardization, the outcome was VRML97 which is almost identical to VRML 2.0.

  5. Technical Stuff - Viewing • In order to see VRML worlds, we need to install a VRML browser (or player). • Internet Explorer comes with a default VRML browser, and almost all other internet browsers can install one.

  6. Technical Stuff - Editing • VRML can be edited by any text editor. • There are many available VRML editors (with context highlighting). • For more complex worlds, 3D modeling programs can be used and the result can be translated to VRML. • The basic output file format is TEXT, but the browsers can read compressed files (compressed with gzip).

  7. Demo!! • This is a simple demo to demonstrate basic features of the VRML environment

  8. VRML Syntax • Each VRML file must start with the comment line:

  9. Basics • VRML world is made out of nodes, which are types of objects. • Inside the nodes there are fields which are properties of the node and have a Default. • A node structure is : NodeName { filedName value }

  10. Nodes Cont. • Nodes can be nested:

  11. Some Important Nodes • Lets look at this simple code: Node Node Fields WHAT IS THIS: Fields Node

  12. Reuse of Nodes

  13. Transformations: • Regular affin transformations: • Translation • Rotation • Scaling • Direction of the axes are standard • Every thing works by the right hand rule

  14. Example:

  15. Apperence: • Appearance node can have two fields: • material • texture

  16. Materials: • The material field can have a Material node. • The material node can have these fields: • diffuseColor. • The normal color of the object. • specularColor. • The color of highlights on shiny objects.

  17. Materials: • emissiveColor. • The object 'glows' with a light of its own of this color. It doesn't cast light on any other objects though. • ambientIntensity. • The amount of ambient light that the object reflects. • shininess. • How reflective the object is. • transparency. • How transparent the object is. Note, some browsers will not support partly-transparent objects.

  18. Some Materials:

  19. Textures: • appearance field can specify a texture. • There are several types of textures. • Image textures: defined by a jpg files. • Movie textures: defined by a mpg file. • Pixel textures: user defined textures.

  20. Other Basic Shapes: • Box • Cylinder • Cone • Sphere • Text

  21. Cameras & Viewpoints • We can set many viewpoints to our world. • A viewpoint is defined by : • position : [z,y,z] coordinates of the camera. • orientation : were the camera looks at ( [x,y,z] =axes + angle of rotation). • fieldOfView: angle in radians between 0 and pi. • description : name of the viewPoint. • Some VRML browsers allow specification of entrance camera in the link to the world: world.wrl#CAM1

  22. Cameras Cont.

  23. Background & Fog • Background of the world can be set in two ways: • Map a texture over a surrounding box. • Define a gradient of sky & ground around the center. • Fog enables creating the allusion of distance.

  24. Sound

  25. Sound { SFVec3f direction 0 0 1 SFFloat intensity 1 SFVec3f location 0 0 0 SFFloat maxBack 10 SFFloat maxFront 10 SFFloat minBack 1 SFFloat minFront 1 SFFloat priority 0 SFNode source NULL SFBool spatialize TRUE } Sound Node

  26. Sound Node Cont. direction Min back Min Front Max Front Max back

  27. AudioClip { SFString description "" SFBool loop FALSE SFFloat pitch 1.0 SFTime startTime 0 SFTime stopTime 0 MFString url [] } AudioClip Node

  28. Objects of Desire • We can build objects other than the three default shapes by specifying coordinates of the vertexes. • Specify coordinates: • Specify Normals: • Specify direction:

  29. General Objects

  30. Setting Normals

  31. Lighting • There are three kinds of lights in VRML: • Directional Light: A light with no specific location in space only a direction. (gives a sun effect). • Point Light: A light that have a specific location and shines evenly to all directions. • Spot Light: A light with a specific location that shins in a set angle to a specific direction.

  32. Spot Light: Beam width Spot Light Cutoff angle Direction

  33. Dynamic Worlds • We can specify to the browser what Navigation capabilities the user will have: • Walk • Examine • None

  34. Events & Routes • Most nodes contain events. • If a field in a node is exposed, the node has two defined events for it: • Set_fieldName – used to set the value of the field. • fieldName_changed – generated when the value was changed. • The ‘set’ and ‘changed’ can be left out. • Not all fields are exposed.

  35. Touch time Route Start time Events & Routes • A ROUTE wires two events together. Touch Node Sound Node DEF SENSOR TouchSensor { } DEF SOUND Sound { } ROUTE SENSOR.touchTime TO SOUND.startTime

  36. Sensors • There are several types of sensors in VRML: • Time Sensors • Visibility sensors • Collision Sensors • Proximity Sensors • Touch Sensors • Sphere Sensors • Cylinder Sensors • Plane Sensors

  37. Sensor Code Example

  38. Interpolators • Used to interpolate between key values • Several kinds of interpolators: • Color • Orientation • Coordinate • Normal • Position • Scalar

  39. Bounded Nodes • We can bind some nodes to values in other • Background • Fog • NavigationInfo • Viewpoint

  40. Programming!? • Real animation must include some sort of programming. • VRML accepts two kinds of programs: • JAVA. • JavaScript. • The script node can receive end send events very easily.

  41. Script Demo

  42. JAVA • In order to use Java instead of JavsScript all we need to do is to write the appropriate class and include it in the script node: Script { url "NewScript.class" }

  43. Examples

  44. Bibliography • Floppy's VRML Guide - VRML97 Tutorial • WEB3D CONSORTIUM – • http://www.vrml.org/ • VRML97 Specification, ISO-IEC 14772-11997 • http://www.vrml.org/technicalinfo/specifications/vrml97/index.htm • Biota.org - Creatures Gallery – • http://www.biota.org/gallery/index.html

More Related