IBM TJ Watson Research

IBMBouncingBall

IBMBouncingBall.mp4

Description

The Circle on the left is moved using a PositionInterpolator2D driven from a TimeSensor. The velocity is constant between the limits of the range (which are the only points specified by the interpolator), the limits being the top and bottom of the 'bounce' path.

The Circle on the right has the same basic setup except that its TimeSensor is wrapped by a TemporalTransform. The speed of that TemporalTransform is linearly increased from 0, or decreased back to 0, between the endpoints as it bounces. It thus accelerates towards the ground and decelerates back up again. The cycleIntervals are set such that the time taken to 'fall' is the for both Circles.

In the screenshot the Circle on the left has dropped further since it had constant velocity during the 'fall', the Circle on the right will catch up as its speed increases so that they both hit the ground at the same time.

This technique can be used say for pendulums or to create the so-called ease-in/ease-out effect for more realistic motion. The same sort of effect could also be achieved using piecewise linear approximation for the path - that however requires (many) more points in the path so using a TemporalTransform is more efficient.

Screenshot

Snapshot taken during position interpolation.



Back to main index