An alpha object produces a value, called the alpha value, between 0.0 and 1.0, inclusive. The alpha value changes over time as specified by the parameters of the alpha object.

The alpha object waveform has four phases: increasing alpha, alpha at one, decreasing alpha, and alpha at zero. The collection of all four phases is one cycle of the alpha waveform. These four phases correspond with four parameters of the Alpha object. The duration of the four phases is specified by an integer value expressing the duration in milliseconds of time.

This program illustrates the usage of Alpha through moving the car by different Alpha object.

 public BranchGroup createSceneGraph() {
    ...

    // create Alpha that continuously cycles with a period of 1 sec
    Alpha alpha1 = new Alpha();

    alpha1.setIncreasingAlphaDuration(2000);
    alpha1.setAlphaAtOneDuration(1000);
    alpha1.setDecreasingAlphaDuration(2000);
    alpha1.setAlphaAtZeroDuration(1000);

    // create position interpolator
    PositionInterpolator posInt1 = new PositionInterpolator(alpha1,
        objMove1);
    posInt1.setSchedulingBounds(new BoundingSphere());

    posInt1.setStartPosition(-1.0f);

    objRoot.addChild(objPos1);
    objPos1.addChild(objMove1);
    objMove1.addChild(createCar(0.4f, 0.4f));
    objRoot.addChild(posInt1);

    ...
    
    Alpha alpha2 = new Alpha();

    alpha2.setIncreasingAlphaDuration(2000);
    alpha2.setAlphaAtOneDuration(1000);
    alpha2.setIncreasingAlphaRampDuration(500);

    ...

    Alpha alpha3 = new Alpha();

    alpha3.setIncreasingAlphaDuration(2000);
    alpha3.setAlphaAtOneDuration(1000);
    alpha3.setIncreasingAlphaRampDuration(1000);

    ...
  }