Explanations on ex-timetouchsensor.wrl [return]
Here 2 nodes are defined (a sphere and a box) both translated
to the origin and associated to a TouchSensor.Two time sensors are
also defined. Additionaly two Interpolations are defined and a text
at (0,0,0).
The Routes define the following associations as stated in Figure 3 :
Figure 3. Routes and Events for ex-sensor.wrl
- ROUTE STOUCH.touchTime TO XTIMERH.set_startTime
- the sphere sensor, TouchSensor node - STOUCH, sends one time event to
the TimeSensor node (XTIMERH). This event (a time value) is sent when the user clicks (touchs - the mouse button) with the cursor over the sphere
- ROUTE XTIMERH.fraction_changed TO ANIMAH.set_fraction
- the TimeSensor (XTIMERH) receives a start_time input-event and will
run until the end of the present cycle, generating continously fraction
events (SFFloat)
- ROUTE ANIMAH.value_changed TO SFORM.set_translation
- the PositionInterpolator (ANIMAH) receives the fraction
input-events causing the interpolator function to evaluate. The
result of the linear interpolation is sent to the value_changed (SFVec3f)
- each output value will be the input to the exposedField translation of the
SFORM node (the text), causing the text to translate in the X-axis.
For the translation in the Y-axis an envolving the TouchSensor defined
to the box we have an analogous procedure.