Lighthouse3d.com

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

ZF~ 4 Xy,ox³rXRlL{E@\O66 MjbFB^WYݛ0KիkU¯ok 3=ӱHC{Qx 08K8|>\bI}(-$qҙlcFX'&1E,DCsUu˺^ͺuu%,|Ϳ6k$Z[o1XUz5y}ݫDg%4?Ou|{Q,^8(usZߛY%p`"m-\ Iԧw2Be#?j̯}"Y*xv2%H6H ? Pb3/Nهg3U0 h'fz.#1!tӱҧT $'_*H-I@Ƿ,Dir+ƷyR\ƌ>zt> bJI?yt%ҧ_ @4^C ’&^zaʼ0lɆB0I0;cru qijQЁ6Wܲ4!yx$&Ƴ4ć)BЦ Bv:yu3AO) IJ5BCR#$/x:*7E#JS :]& (d[삡jT>{J7?O h}44Ma,, IGb-t#9nv4Ck=g"nyKϷ@Ql*"&!zg*|HgU!f^#e,qﮅ S>) )B.yJ(/ "%Qh=.)[gxdq ɐ*@Jx(t. e}Jj@i_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:6}7sY5K'(uO68?+=YjLLeBsգ7 {`>}ɞ,] DM?Js$钏{ͦz2W~"ܾ>߾m^mű *)ny̿gxZ0XeSˆ#˜-Beu}=OZ; - {8ͽ=mRNThb+)ٯxιUyRx29m,ΡjW@(3d){1^GW:$)h')(?Lzr.L]Ob2UX*Z N'8Z2]*pi;L3bnoRМ?bkgv'|6Lun+#<̓NG ǟߓ%;?2$LZ<xig $DtW1"2UA{xmRqs8'EDK`Y6Z zg 7 :*z$iA4OG Jկ1&C<ߌrsi0ȌU+cՍhAεOw|LI\shxMMkfwʷ4#)C{@.$ OiyT/^`_$>Se9JS FPnOkIA)=?10 T#@cEIDgNl ڴ80T4ɵb,9*5J^ўfk?ANwIs{)ͫX6F)S<%۝Oې: MT;4ߡd-_O7؇_δzK+5h^= Pn G/1ʬUR8Xܿ*_ڙ,IoEd _Z3;j`oO{8N:I&IQq8"9Y'xfALVG0}'weo8T5UΧq}x Y^""4%xQps, ^y7 s 2!YXZqZ5+'gJ,!͌նay\CFܶ?SVHUx d౯n԰ =`8w{c])q3ұ1m|n zEuTxF:R}B2hG:K[\҃ eОV6`f7};WLuc4w}ϟ &6u9^e|'z=-ȹ\iLqǛ(.wi'i/W>F4{=4f ߉4^86[Zmg&m돃fp .+B,T& V2uG7ǯ[6@

ProximitySensor Node


The ProximitySensor node is a way of providing interactivity with the user. The sensor generates events when the user enters, leaves or moves in a defined rectangular box. This sensor does not relate to the shapes defined within the same group, i.e. it does not detect if a shape within a group is close to the user or not.

This node has the following fields:
  • enabled specifies the status of the sensor;
  • center determines the center of the rectangular box;
  • size specifies the size of the box.
  • The isActive event is generated with the value TRUE by this node when the field is enabled and the mouse moves from a position outside the box to a position inside the box. A value FALSE is provided by this event when the sensor is enabled and the mouse leaves the box.

    An event enterTime is generated when the user enters the box, the event exitTime is generated when the user leaves the box.

    When the mouse is inside, enters or leaves the box, the following events are generated when the mouse moves:
  • position_changed: Provides the 3D position of the user in the sensor's coordinate system.
  • orientation_changed: provides the users orientation.


  • Syntax:
    ProximitySensor {
    enabled TRUE
    center 0 0 0
    size 0 0 0
    }


    When defining several ProximitySensor inside nested groups, all the sensors will generate events when the user is inside the respective boxes.

    Example of a ProximitySensor to turn on and off a light. The light is turned on as soon as the user enters the Box, and off when the user leaves the box:

    The following source code describes a group with a Visibility Sensor and a Sound.

    Example:
    #VRML V2.0 utf8
    Group {
      children [
        DEF ps ProximitySensor { size 4 4 4}
        DEF sl SpotLight { on FALSE location 0 0 4}
        Shape { appearance Appearance {material Material {}}
          geometry Sphere {}
        }
      ]
    }
    ROUTE ps.isActive TO sl.set_on