Alpha sphereShrinkAlpha = new Alpha(1,2000);
//The starting time is first postponed until "infinity".
sphereShrinkAlpha.setStartTime(Long.MAX_VALUE);
ScaleInterpolator shrinker = new ScaleInterpolator(sphereShrinkAlpha,
tgmBSphere,
new Transform3D(),
1.0f,0.5f);
shrinker.setSchedulingBounds(bounds);
tgmBSphere.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
tgmBSphere.addChild(shrinker);
//The same for the growing sphere.
Alpha sphereStretchAlpha = new Alpha(1,2000);
sphereStretchAlpha.setStartTime(Long.MAX_VALUE);
ScaleInterpolator stretcher = new ScaleInterpolator(sphereStretchAlpha,
tgmBSphere,
new Transform3D(),
0.5f,1.0f);
stretcher.setSchedulingBounds(bounds);
tgmBSphere.addChild(stretcher);
//A transformation group for positioning the sphere.