IBM TJ Watson Research

IBMAccumulator

IBMAccumulator.mp4

Description

The accumulator uses the technique presented in IBMIncrementer to increment a counter. The counter is used the to form an X offset and a Y offset for a PositionInterpolator2D using further valuators. The individual offsets are then fed to Offset1 and Offset2 of a final valuator through which the output of the interpolator is also routed. The resultant outSFVec2F is then routed to the translation field of a Transform2D. The TimeSensor that drives the interpolator also is used to increment the count.

The path of movement in the PositionInterpolator2D has a 0,0 origin. The X and Y offsets are the differences between this initial path position and in the interpolator and the final one. In this case 3 and 2 respectively.

The initial position is set by the valuator that is doing the incrementing. Its Factor1 is set to -61.0. But since there is a cycleInterval immediately when the TimeSensor starts the first value to actually take effect will be -60.0. -60 times the 3x2 offset is -180,-120. The preferred screen dimensions are 360x240 and hence the small blue circle, used to show the movement, starts in the lower left corner. Each run through the interpolator has 16 positions that move the circle in an approximately circular path ending up 3 pixels to the right and 2 pixels up from the starting position. With the TimeSensor set to loop the next path starts where the last one ended. This technique can be used the map accumulative animation in SMIL.

The TimeSensor has a cycleInterval of 2s and so the circle disappears off the top right upper corner after a period of 120 seconds (360 screen width divided by 3 pixels accumulation each second).

Screenshot

Snapshot taken while running. The blue circle moves in a roughly circular path in an anti-clockwise direction. The circular path being roughly a radius of 10 (the circle itself has a radius of 2).



Back to main index