Set Alpha Color of a PointArray
I'm unable to fix a problem which seems to be very easy, but after trying several things, asking Google a lot of time and searching on java.net forum, I didn't found the solution.
Here is my problem. I want to represent a set of points using PointArray :
float coords = new float[size * 3];
float colors = new float[size * 4];
// I fill the coordinates and color arrays
// The color array is filled like this :
// colors[i * 4] = rValue;
// colors[i * 4 + 1] = gValue;
// colors[i * 4 + 2] = bValue;
// To test if the alpha parameter is efficient I set it to 0
// colors[i * 4 + 3] = 0.0f;
// Assign the coordinates and the color to a pointarray
PointArray ptArray = new PointArray(size, GeometryArray.COORDINATES |
GeometryArray.COLOR_4 | GeometryArray.BY_REFERENCE);
The coordinates are OK, the colors are OK instead of the alpha parameter which is absolutely not considered (whatever the given value).
The aim of this code is to make points disappear dynamically. If I use a TransparencyAttributes, it will be applied to all points.
Have you any idea where the problem is ? It's weird that the color of each point in my PointArray is correct instead of the alpha parameter.