P. 1
iNTRODUCCION_VRM-ejemplos

iNTRODUCCION_VRM-ejemplos

|Views: 2|Likes:
Published by Yaco Garay

More info:

Published by: Yaco Garay on Sep 20, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PPT, PDF, TXT or read online from Scribd
See more
See less

12/19/2015

pdf

text

original

Introduction to VRML

By Salman Yussof Diego Iglesias

What is VRML?
VRML stands for Virtual Reality Modelling Language and is pronounced ‘vermil’.  It is a standard for delivering 3D rendering on the net, just like HTML is a standard for web pages.  VRML is a subset of the Open Inventor standard developed by SGI for their graphics workstation.

The ‘World’ representation   VRML includes many of the things that go into making a world. The files are called ‘worlds’ and have ‘. as well as light. It has a way of describing geometry which creates objects and spaces in which you can move around. It is from this ‘worldly’ imitation that VRML files get their name. . texture and sound which can be approached and viewed from whatever angle.wrl’ extension.

lighting. texture and linking. It describes the foundations of a world including geometry.0 is designed to meet the following requirements: – Platform independence – Extensibility – Ability to work well over low-bandwidth connections  No support for interactive behaviors .0    This is the first generation of VRML. color.VRML 1. VRML 1.

VRML Architecture Board made it official in March 1996 .0    This is the current generation of VRML.VRML 2. It has a richer level for interactivity and includes support for animation.0. spatial sound and scripting in addition to features that are already supported in VRML 1.

VRML97   VRML 97 is the ISO standard for VRML It is developed based on VRML 2.0 .

Features in VRML97 More realism in static worlds Sound objects with controllable attenuation  An efficient system to describe irregular ground terrains  Extrusion objects for advanced but compact modelling  A more powerful background coloring and panorama system  A fog system allowing underwater and cloudy environments to be represented  The ability to use MPEG video as a texture map  .

Features in VRML97 Interaction from sensors: Collision detection gives the user a sense of substance as they move in the world  Touch sensors allow reactions to a users deliberate actions  Proximity sensors allow reactions to a user’s not so deliberate actions  Visibility sensors allow conservation of resources  .

 Scripting in JavaScript or Java allows everything from simple logic devices to fully blown analytical engines providing a wealth of complexity.  .  Prototypes extend the existing variety of object types with efficient reuse and simple scene graph structure. behaviors and beyond: Interpolators provide engines to implement animation of any sort.Features in VRML97 Motion.  A navigation information object provides the browser software with details of the speed and nature of the users movements in the world.

0 utf8 Comments indicated by ‘#’ sign Terminology: – Nodes: a world is made up of nodes which are types of objects – Fields: describe properties of a node . case sensitive Header: – #VRML V2.Writing VRML descriptions     VRML code is simply a text file.

Example #VRML V2.0 utf8 WorldInfo { title "Example 1" } DEF FBOX Shape { appearance Appearance { material Material { diffuseColor 0 0.5 0 } } geometry Box { } } Node Field (uses default values) .

75 1.Shapes   Box – geometry Box {size 5.0} Cylinder – geometry Cylinder {radius 0.000.5 3.000} Text & FontStyle .5 height 10 top FALSE} side TRUE  Cone – geometry Cone {bottomRadius 5 height 10 bottom FALSE}   Sphere – geometry Sphere { radius 10.

some browsers will not support partly-transparent objects.Materials  Material Node properties: – diffuseColor: The normal color of the object – specularColor: The color of highlights on shiny objects – emissiveColor: The object 'glows' with a light of it's own of this color. . Note. It doesn't cast light on any other objects though reflects – ambientIntensity: The amount of ambient light that the object – shininess: How reflective the object is – transparency: How transparent the object is.

and Scaling   Applied in following order (use nesting for custom) – Scale. Rotation. the Translate Example: Transform { translation 1 1 1 rotation 0 1 0 0.Transformations    Distances measured in meters (convention) Angles measured in radians Transformation types: – Translation. then Rotate.78 scale 2 1 2 children [ USE FBOX ] .

0 utf8 Transform { children [ NavigationInfo { headlight FALSE } # We'll add our own light DirectionalLight { direction 0 0 -1 } # First child # Light illuminating the scene Transform { # Second child .Example 1 #VRML V2.3 } appearance Appearance { material Material { diffuseColor 1 0 0 } # Red } } ] } (…) .a red sphere translation 3 0 1 children [ Shape { geometry Sphere { radius 2.

Example 2 #VRML V2.2 } } } Transform { translation -2 0 0 children USE Joe } ] } .0 utf8 Transform { children [ DEF Joe Shape { geometry Sphere {} } Transform { translation 2 0 0 children DEF Joe Shape { geometry Sphere { radius .

6 .5 0 -. only the legColor and topColor fields # are public.5 0 -.5 0 .6 0 children Shape { appearance Appearance { material Material { diffuseColor IS topColor } } geometry Box { size 1.4 .5 children USE Leg } ] # End of root Transform's children } # End of root Transform } # End of prototype # The prototype is now defined.Example 3 #VRML V2.8 .0 utf8 PROTO TwoColorTable [ field SFColor legColor .6 .5 children DEF Leg Shape { appearance Appearance { material Material { diffuseColor IS legColor } } geometry Cylinder { height 1 radius .7 field SFColor topColor . Although it contains a # number of nodes. Instead of using the default legColor and # topColor.5 children USE Leg } Transform { # another table leg translation .2 0.1 ] { Transform { children [ Transform { # table top translation 0 0.5 children USE Leg Transform { # another table leg translation -.5 0 .2 1.1 } } } Transform { # another table leg translation .2 } } } Transform { # first table leg translation -. this instance of the table has red legs and # a green top: TwoColorTable { legColor 1 0 0 topColor 0 1 0 } NavigationInfo { type "EXAMINE" } # Use the Examine viewer .

Example 4 #VRML V2.touchTime TO OpenVault.isOver TO OpenVault.startTime .0 utf8 DEF OpenVault Script { # Declarations of what's in this Script node: eventIn SFTime openVault eventIn SFBool combinationEntered eventOut SFTime vaultUnlocked field SFBool unlocked FALSE Sound { source DEF Click AudioClip { url "click. } function openVault(value) { if (unlocked) vaultUnlocked = value.wav" stopTime 1 } minFront maxFront minBack maxBack 1000 1000 1000 1000 # Implementation of the logic: url "javascript: function combinationEntered(value) { unlocked = value. }" } Shape { appearance Appearance { material Material { diffuseColor 1 0 0 } } geometry Sphere { } } } DEF TS TouchSensor { } ROUTE TS.vaultUnlocked TO Click.openVault ROUTE OpenVault.combinationEntered ROUTE TS.

Additional Examples        Interpolation Interaction Tour Distance Sensor Graphics (1) Graphics (2) Graphics (3) .

web3d.com/vrmlguide/ – http://www.Acknowledgements  Example VRML code from – http://www.html .vapourtech.org/Specifications/VRML97/part1/exampl es.

0 Specification – http://www.edu/    VRML 1.org/Specifications/VRML97/ .References   VRML Consortium/Web3D – http://www.org/VRML1.vrml.org/VRML2.vrml.web3d.0/vrml10c.html VRML 2.0 Specification – http://www.org/ VRML repository: – http://vrml.0/FINAL/ VRML97 Specification – http://www.sdsc.vrml.

org/Specifications/VRML97/part1/exampl es.edu/~jacross/graphics/mybook.htmlx Links to good examples: – http://www.com/vrmlsite.html .3d-design.web3d.html   3D Web Graphics Using VRML Book Examples – http://www.Examples  VRML97 Examples – http://www.iup.

hiwaay.edu/cgibin/display.cgi?category=Tutorials+-+VRML .net/~crispen/vrmlworks/tutorials/index.vapourtech. html   Cosmo VRML Tutorial – http://cosmosoftware.Tutorials   VRML97 Tutorial – http://www.html VRML Repository Tutorial links – http://vrml.com/vrmlguide/ VRML Works Tutorial – http://home.sdsc.com/developer/tutorials.

in particular the time sensor  The Tour example was implemented using the time sensor approach – An array of tour positions is defined together with a way to interpolate between them – A touch sensor determines when the timer is started – Each tick of the timer is routed to the position interpolator which sets a new orientation and translation .Questions (and Answers)   Q: How to define the trajectory of the walk-through example? A: There are two ways in which to implement the tour: – Using javascript to control the viewer’s camera position – Using VRML sensors.

0. 0 1 0 5.set_fraction ROUTE GuidePI. 0.8. 0 0 0 ] } DEF GuideRI OrientationInterpolator { key [ 0.8.3.9. ] } DEF TS TimeSensor { cycleInterval 30 } # 30 second tour ROUTE StartTour.fraction_changed TO GuideRI. 0 0 -5. 0 1 0 3. 0 1 0 0. 0 1 0 0.6.set_rotation . 0.5.Tour Example  Relevant source code DEF GuidePI PositionInterpolator { key [ 0.value_changed TO GuideTransform.startTime ROUTE TS.9. 0 1 0 3. 0 1 0 0. 2 6 -15 -4 6 -15. 1 ] keyValue [ 0 0 0.5. 0.3. 0 1 0 1. 0.2.set_fraction ROUTE TS. 0. 0. 0 0 -5. 0.2.value_changed TO GuideTransform.2.6.set_translation ROUTE GuideRI. 1 ] keyValue [ 0 1 0 0. 2 0 -5.5. 0. 0. -4 0 -5. 0.touchTime TO TS. 0.fraction_changed TO GuidePI.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->