X3D Example Archives: Conformance Nist, Sensors, Time Sensor

 

TimeSensor continuously generates events as time passes. Typical use: ROUTE thisTimeSensorDEF.fraction_changed TO someInterpolatorDEF.set_fraction.

X3D Tooltips of interest: TimeSensor.

X3D Specification sections of interest: 8 Time component, 8.2 Concepts and 8.4.1 TimeSensor.

X3D Examples Archives of related interest:

 
  19 X3D Models       X3D Model Descriptions
   cycleinterval cycleinterval By setting the cycleInterval field to 5, the animation of a red Sphere geometry should take 5 seconds to complete. When the geometry is indicated by the pointing device, it should move from center, to right, to center, to left and back to center in 5 seconds.
   cycletime cycletime Test if TimeSensor sends cycleTime event at the start of each cycle. The world includes two TimeSensors: TIME1 and TIME2. The cycleTime field for TIME1 triggers startTime for TIME2. When clicking the red sphere, the ball starts to move, complete one cycle of animation in 2 seconds, stop, and move again after 3 seconds.
   default_timesensor default timesensor Test default TimeSensor properties. Using default TimeSensor values, a red Sphere geometry is associated with TouchSensor. Indicating the Sphere with a pointing device sends the "touchTime" event to the default TimeSensor "startTime" field. The TimeSensor drives an animation of the Sphere, for a duration of 1 second (the default cycleTime), and does not repeat (because loop is false). The Sphere should move to the right, to center to left, and back to center one time, taking one second of time.
   enabled enabled With the enabled field set to false, a startTime event sent to a TimeSensor that animates the movement of the red Sphere geometry will not start the TimeSensor. The result should be, indicating the red Sphere with a pointing device does NOT start its movement.
   fraction fraction Test the fraction_changed field of a TimeSensor node. Two TimeSensors with cycleIntervals of 2 and 4 seconds animate a blue and green Sphere geometry respectively along the same distance. Because the cycleInterval of one TimeSensor is half that of the other, the fraction_changed events are routed to one PositionInterpolator twice as fast as the other TimeSensor, and the blue Sphere completes its animation twice as fast as the green Sphere. To verify this, click on the red Sphere to start the animation.
   isactive Test if TimeSensor sends isActive true event when it is running, and sends isActive false when it is stoped. A central white Sphere geometry has an associated TouchSensor that sends its touchTime event to the TimeSensors startTime field. The TimeSensors isActive event is sent to a PointLights "on" field. As a result: when the pointing device indicates the central Sphere, the TimeSensor should turn the PointLight on, and keep it on for 3 seconds (the cycleInterval value). After the cycleInterval completes, the light should turn off.
   loop loop Test loop equals true. With the loop field set to true on a default TimeSensor node, the TimeSensor will continuously loop and generate events. The result is, a red Sphere geometry will continuously move from left to right in a loop forever when the world is loaded into the browser.
   stopeqstartloopfalse stopeqstartloopfalse Test TimeSensor behavior when stopTime equals startTime, and loop is set to false. A stopTime and starTime of 5 (5 seconds past midnight, January 1, 1970) are assigned to a TimeSensor node. EventOuts from this node are routed to start an animation of a red Sphere geometry. The result is: Because loop is false, a red Sphere geometry should NOT move from right to center to left and back to center one time when the world is loaded.
   stopeqstartlooptrue stopeqstartlooptrue Test TimeSensor behavior when stopTime equals startTime, and loop is set to true. A stopTime and starTime of 5 (5 seconds past midnight, January 1, 1970) are assigned to a TimeSensor node. EventOuts from this node are routed to start an animation of a red Sphere geometry. The result is: StopTime should be ignored. A red Sphere geometry should move from right to center to left and back to center forever when the world is loaded.
   stopgtstartloopfalse stopgtstartloopfalse Test TimeSensor behavior when stopTime is greater than startTime, and loop is set to false. A stopTime of (5) and starTime of (1) (1 second past midnight, January 1, 1970) are assigned to a TimeSensor node. EventOuts from this node are routed to start an animation of a red Sphere geometry. The result is: EventOuts should not be generated by the TimeSensor node. Because loop is false, a red Sphere geometry should NOT move from right to center to left and back to center one time when the world is loaded.
   stopgtstartlooptrue stopgtstartlooptrue Test TimeSensor behavior when stopTime is greater than startTime, and loop is set to true. A stopTime of (5) and starTime of (1) (1 second past midnight, January 1, 1970) are assigned to a TimeSensor node. EventOuts from this node are routed to start an animation of a red Sphere geometry. The result is: EventOuts should not be generated by the TimeSensor node. A red Sphere geometry should NOT move from right to center to left and back to center forever when the world is loaded.
   stopltstartloopfalse stopltstartloopfalse Test TimeSensor behavior when stopTime is less than startTime, and loop is set to false. A stopTime of (1) and starTime of (5) (5 seconds past midnight, January 1, 1970) are assigned to a TimeSensor node. EventOuts from this node are routed to start an animation of a red Sphere geometry. The result is: Because loop is false, a red Sphere geometry should NOT move from right to center to left and back to center one time when the world is loaded.
   stopltstartlooptrue stopltstartlooptrue Test TimeSensor behavior when stopTime is less than startTime, and loop is set to true. A stopTime of (1) and starTime of (5) (5 seconds past midnight, January 1, 1970) are assigned to a TimeSensor node. EventOuts from this node are routed to start an animation of a red Sphere geometry. The result is: StopTime should be ignored. A red Sphere geometry should move from right to center to left and back to center forever when the world is loaded.
   stoptime stoptime Test TimeSensor behavior when stopTime equals startTime, and loop is set to false. A TouchSensor routes its touchTime event to both a TimeSensors startTime AND stopTime field. The result is: A red Sphere geometry should move from right to center to left and back to center one time when the Sphere geometry is indicated by the pointing device.
   stoptime_1 stoptime 1 Test TimeSensor behavior when stopTime is less than startTime, and loop is set to false. A TouchSensor routes its touchTime event to a TimeSensors startTime field. The stopTime field is set to 0. The result is: the stopTime field should be ignored, and a red Sphere geometry should move from right to center to left and back to center one time when the Sphere geometry is indicated by the pointing device.
   stoptime_1_looptrue stoptime 1 looptrue Test TimeSensor behavior when stopTime is less than startTime, and loop is set to true. A TouchSensor routes its touchTime event to a TimeSensors startTime field. The stopTime field is set to 1. The result is: indicating the red Sphere with the pointing device should set the startTime for the TimeSensor to "now". The stopTime field (because it is set to 1) should be ignored, and a red Sphere geometry should move from right to center to left and back to center forever.
   stoptime_2 stoptime 2 Test TimeSensor behavior when stopTime is greater than startTime,and loop is set to false. A red Sphere geometry has an associated TimeSensor . A TouchSensor also associated with the Sphere sends its touchTime event to the TimeSensors startTime field. As a result, indicating the moving Sphere geometry with the pointing device should start the Sphere movement. A green Box geometry has an associated TouchSensor. The touchTime event of the TouchSensor is routed to the set_stopTime field of the red Spheres TimeSensor. Results should be: indicating the red Sphere geometry with the pointing device should start the Sphere movement. Indicating the green Box geometry with the pointing device should stop the Sphere movement. If the green Box is not indicated by the pointing device after the Sphere starts moving, the Sphere should stop its movement after its 5 second cycleTime.
   stoptime_2_looptrue stoptime 2 looptrue Test TimeSensor behavior when stopTime is greater then startTime, and loop is set to true. A red Sphere geometry has an associated TimeSensor . A TouchSensor also associated with the Sphere sends its touchTime event to the TimeSensors startTime field. As a result, indicating the moving Sphere geometry with the pointing device should start the Sphere movement. A green Box geometry has an associated TouchSensor. The touchTime event of the TouchSensor is routed to the set_stopTime field of the red Spheres TimeSensor. Results should be: indicating the red Sphere geometry with the pointing device should start the Sphere movement. Indicating the green Box geometry with the pointing device should stop the Sphere movement. If the green Box is not indicated by the pointing device after the Sphere starts moving, the Sphere should continue its movement forever.
   stoptime_looptrue stoptime looptrue Test TimeSensor behavior when stopTime equals startTime and loop = true. A TouchSensor routes its touchTime event to both a TimeSensors startTime AND stopTime field. The result is: If the red Sphere geometry is indicated by the pointing device, it should move from right to center to left and back to center continuously.

The X3D Resources: Examples page and Savage Developers Guide provide more information about the production of this archive.