Question about transparency

It’s your material. Your material is specifying a diffuse color, which hides the color specified by setColor() (including its alpha channel).

An object has multiple places in which color may be defined. Most objects just use the vertex color, and don’t have a lighting material (or if they do have a lighting material, the material doesn’t have an explicit diffuse color specified, which means it shows the vertex color).

Since your object has a material with a diffuse color, whenever lighting is enabled that diffuse color is used instead of the vertex color. That’s what a material means: use this color instead of whatever color you find on the object.

You have three choices.

(1) Instead of using setColor(), use setMaterial() to change the color, and use a material with a different color.

(2) Edit the egg file to remove the diffuse color from your material, and instead specify the color you want via entries on your vertices or polygons.

(3) At runtime, use setMaterial() to apply a material with no diffuse color specified, and then use setColor().

If your egg file was created via a model converter, it may be difficult to employ option (2).

David