Lighthouse3d.com

uW(.JUMLO-O)ͭKLSW(L)ɰU7TWHL(3RRl bJP< Send me bugs and suggestions, please
VRML Script Tutorial
Full list

VRML Interactive Tutorial

Introduction
VRML File Structure
Drawing: Shape node
Geometry Nodes:
Box
Sphere
Cone
Cylinder
PointSet
IndexedLineSet
IndexedFaceSet
Extrusion
ElevationGrid
Example: Chessboard
Text
FontStyle
Appearance
Material
Textures
Image Texture
Movie Texture
Pixel Texture
Texture Coordinate
Texture Transform
Let there be Light
Directional Light
Point Light
Spot Light
Materials with Colored Lights
Hierarchical Node Structures
Group
Transform
Collision
Anchor
Billboard
Switch
Inlining Files
Defining and Instancing Nodes
Defining Levels of Detail
Events in VRML
Creating Paths between events: ROUTE
Generating Events based on Timers or User Actions
Timers
Touch Sensor
Visibility Sensor
Dragging Sensors
Plane Sensor
Sphere Sensor
Cylinder Sensor
Proximity Sensors
Example: Proximity sensor
Interpolators
Color
Coordinate
Normal
Orientation
Position
Scalar
Example
Let the Music Play
Sound
AudioClip
Bindable Nodes
Who Am I: NavigationInfo
Where Am I: ViewPoint
Adding Realism to the world
Background
Fog
Information about your world
WorldInfo
Definition for Auxiliary Nodes
Coordinate
Color
Normal

}[6X>[rDj3%';sEBmdxnayvV RDo.g:N7  B ?z/ސUv/Ϟ?V΂| >^J{pA\[NS~j۵E|XqM:uaZtU_w MuBXD$+3p(V?Pvݰ?ww8=nb۶i=Z/(߅aE)0}|EM5Mb0ois\LBN-AV!]p,WO"ڵm`1 ,5X إ3x~L~_TyÞϣVs>5WD4?bRdN(&PWLF(Y,uQꧨAM@ƝO(E&{\y8:'|m*D!v5%eUc{,hlRt:QlƑz`DZXCr~H;R]R@=O!Da2 e8 :ƱVʸa1 =3Acƨa}}Vui[-/ȷuL:?Wz &͋% LEƥ8CwKLb_iĬxT"諌s Lbi|l 5vZw98tMDγ'$ТvZ)s+R(Yכm0 yW"n;2Gl"q8Ӫ$oi8GvA'##t%Z;.ݴ #ۉLGB;Ӌ/ w݅*nheMe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/?}P

ROUTES


In the section events it was mentioned that a node can send and receive events.

ROUTES are a simple way of defining a path between an event generated by a node and a node receiving an event. The syntax is:

ROUTE Node.eventOut_changed TO Node.set_eventIn
Note: because all exposed fields define implicitly an eventIn and an eventOut fields, you don't have to write the prefix 'set_' or the suffix '_changed'. The following syntax is valid in VRML as long as the eventIn and the eventOut which appear in the ROUTE sentence belong to exposed fields.
ROUTE Node.eventOut TO Node.eventIn
Because every time an exposed field is changed an event is generated it is possible to have a cascade of events being generated. A time stamp is given to each event which is generated, the same time stamp being given for all events in a cascade as if all events in a cascade occurred simultaneously.

Now there is something missing isn't it? In the section events it was mentioned the eventIn of an exposed field was used to set the value of the respective field. However looking at the syntax of ROUTE there is no explicit declaration of what the new value is. As mentioned before in this section "ROUTES are a SIMPLE way of defining a path...", and SIMPLE in this case has some limitations. The new value for the field associated with the eventIn is the value of the field which caused the eventOut to be generated.

Big deal, so what can I do with routes if I can't specify the value for the field that I'm about to set? Well, you actually can do that using a middle man, see Interpolators.

A cascade of events may result in an event being generated more than once in the same cascade, this can cause a loop of events. In VRML loops are not allowed, an event shall only be generated once in each cascade of events. You don't have to worry about this, the browser will disable any event which is repeated with the same time stamp.

It is possible that two different generated events in a cascade are linked with a ROUTE to an eventIn. Results are undefined in this case. You should try to avoid this type of situations.