IBM TJ Watson Research

IBMSwitchImage

IBMSwitchImage.mp4

Description

Tests typecasting for a Valuator.

Choice field of Switch node is constantly changed (every 0.1s) by routing the output of a TimeSensor, via a Valuator, to the choice. The fraction_changed event output of the TimeSensor is a float from 0 to 1.0. This is routed to the inSFInt32 input of a Valuator whose Factor1 value is set to 10. This results in the outSFInt32 output varying between 0 and 10. The Typecasting rules mean that fractional part, of multiplying the input by 10, is truncated to form the output integer that is routed to the Switch choice.

Result is that one of 10 images is displayed from under the Switch for 0.1s before changing to the next choice and repeating the cycle. Each image is 96x96 with a scale factor of 2x2 applied.

Screenshot

Animated GIF of effect of choice alteration.



Back to main index