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

[r8=y Z 35ɜٓqRbW "Aou=;Ov %R4%QRrhn4@uo?wœ;_ 7k*-x f#(Γ\} ;gx%BssB>d; 2>0F~GL׺z=u< ` Ga.J$b%Ud.8W,yWi$8|)MX>gd,Ex! e~IzB[ݯ0j)Vz=[JT`g-|"S k *3Q4Q:/瘙OuS@nȓ|Lˏ~D֏5_dhBY!tNIViF"j`)m'Nl6Drilct3%zゑ2wuyݻÆwAuylC&1ǝ]*]ޕ WWf=N{\roU{L?Zg-g-'| Ae.#[Oͩ5-u!,g: bPbϏ wlcO|係x['NUO#i${σq;5 נĻe@sOeل9[VAp+*P0BqXJlKHct?`McF <Ła]+y~$> @z1yW'|oS ),J;Q֟'gk<+i2pP|,Py n2$+ŶHUW<צڟT W"Hũ1;h&RʧwON/L` l+RBH6/ :}Vla> ͳ~=RmemVe'Ҫho,bRiӶدay]x50z#1DkEM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,kg-4۬p^)e>c!4G+W5Wp+C= kשǾe_HTDޭ=w$R+mBbc}hյĄ:+R b4kSuNeIσU3\Y@?!ߔx2W˺},^\!+)%Vi _+Le<PWt%$ŴLqIxP@CwGQK+p " .0?W8P= N%)HKgP]ȕifJA!s8K H3~- &jIˤb"{*3we^.6cu Ӣ9$%l%O/]mo6 _ _d;u$@Cv lÐ dѱVYr%9(Y[8x$I~W_WYq/9#I3P<_~ ~204Ugy"ѣ{V erus^=RF9xOQM zoqow"~ NFK3iϣoGaw4}ʏqw|-?PGT~Zl?؛{{o4wcASehdjP5~+647tʀ(BI$շYAV*7;WQFeXl,]׃ HAz*w"t.7sERL t2NU6:;F dy[XqgeFIKlr,- Ѕ) WhkBjj H3#(A}O_JM9&w^ɀg nIjLD VNW XT+ъkOi*ZNM _rx$o=H\i  ,_nz`3-U;@un@451$6Oyu/5#]h¬жgI Pi!fE Eb'? KqCf8m)JTKwl\9}G/Y|Ɯ'5 v Vjpz(J#rcHA"bK~LՉl\}K#;ptS{E 8NBd eڂ(X;~G&#g&d"*d j_Oqƃtbmx,>ΓOb c Euۡ \^M[(diR_wUeۤ᥀}^tI?`}7.[R^n&Uv$5Rݞ y=FV#51oWނfI"bX"GXXt"Aȍmؕ}~{>U>^$a LB;]"0!9E|xQ608ёF#C1LxuyZlg?H)t  Oz?:'?\_<:F6E$z{~/8\FK,Mn,yh ԃ;'jA((Cg=cXW/u蔕0Ri3x;5l2Ӊ?Of0< }5HL ݉pW=›A?aTIpoRMIb)s &Om,B{Za 26Q%b­;`|| G~0o&2YiX'\>Vzd/W]ghm^|$PۧO?qLx{q?nSw=n{dr;x[owGgDq{p< h qYzT"{Dҽli7O={j

TimeSensor Node


The TimeSensor node is a clock which generates events as time goes by. The events can be used to perform animation for instance. This node has the following fields:
  • enabled which specifies the status of the sensor
  • startTime which specifies when the TimeSensor starts to generate events. The value of this field is the number of seconds since midnight, January the first, 1970
  • stopTime which specifies when the TimeSensor stops to generate events. The value of this field is the number of seconds since midnight, January the first, 1970
  • cycleInterval specifies the number of seconds that the TimeSensor will generate events
  • loop specifies if when the cycleInterval is over the TimeSensor should be restarted.
  • Note: In VRML time is counted from midnight, January the first, 1970. Some say that the reason for choosing this date as the beginning of time as to do with the birth of the Unix system.

    When the TimeSensor is enabled it will start ticking when the startTime is achieved (a value of 0 means that the TimeSensor will start generating events as soon as the world is loaded). When enabled the timer will continuously, meaning as often as possible, output an event time, with the current time. After that the TimeSensor will stop generating events when either:
  • The stopTime or
  • startTime + cycleInterval is achieved.
  • In the later case, if loop is TRUE, the TimeSensor will start generating events again.

    If using the cycleInterval, the TimeSensor will output an event fraction_changed . The value of this event is between 0.0 and 1.0 and represents the fraction of the cycleInterval elapsed. If loop is TRUE then when the cycleInterval is over the fraction_changed starts over from 0.0, see Interpolators for examples on using TimeSensors.

    The number of times the events will be generated is dependent on the speed of your machine, your browser, the number of applications you're running, etc.

    TimeSensors output one more event: isActive. This event will have the value TRUE when the clock starts ticking, and FALSE when the clock stops ticking.

    Note that setting loop to FALSE will stop the TimeSensor after startTime + cycleInterval seconds from midnight, January the first, 1970. This implies that you have to compute the number of seconds from that date until the time you want to start your TimeSensor. Hard job, isn't it?

    So how do you set a TimeSensor which will output events for only a cycleInterval, i.e. without using loop, when for instance the user clicks a shape?

    The solution is to send an event set_startTime with the current time to the TimeSensor. The problem with this approach is how to compute the current time. Fortunately all sensors in VRML generate events which output a time value when they become active. So basically all you have to do is to route the event generated by the sensor when it becomes active to the eventIn of the TimeSensor set_startTime.

    See the examples provided with Interpolators and Sensors (see the Index for a complete list).

    All fields are optional, the default values being applied if the field is not specified.

    Syntax:
    TimeSensor {
    cycleInterval 1.0
    enabled TRUE
    loop FALSE
    startTime 0
    stopTime 0
    }