< Zurück | Inhalt | Weiter >

PositionInterpolator


The PositionInterpolator can be used to linearly interpolate between two x, y, z positions. The PositionInterpolator modifies a TransformGroup, which will in turn affect the position of all its child Nodes. The TransformGroup must have the ALLOW_TRANSFORM_WRITE capability set.


//create the TransformGroup TransformGroup tg = new TransformGroup();

tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); tg.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);

//create the Interpolator—by default interpolate

//between x = 0 and x = 1

Interpolator interpolator = new PositionInterpolator ( alpha, tg );