< Zurück | Inhalt | Weiter >

From the file Values.xls from the CustomAlphaTest example

0 0

1000 0.1

3000 0.4

4000 0.2

6000 0.8

10000 0.5

12000 0.1

14000 1.0

16000 0.1


The text file defines an ordered series of time and alpha value pairs (figure 12.3). Times are specified in milliseconds.

The FileAlpha class overrides the following Alpha methods.

public void setStartTime(long l) public long getStartTime()

public void setLoopCount( int i ) public int getLoopCount()

public boolean finished() public float value( long time )

Please refer to the FileAlpha class for details.

The CustomAlphaTest is also interesting in that it interpolates the position of a ColorCube using the

FileAlpha and plots the value and time of the FileAlpha on the graph shown in figure 12.3.


Figure 12.3 The FileAlpha class loads times and Alpha values from a file and linearly interpolates between them to provide a highly flexible Alpha function