Hi all,
I've created an Appearance object from a Texture2D object. I've set the
transparency attributes of the appearance also. But, when I change the alpha
value, it doesn't have any effect on the appearance. Anyone got any ideas
why the transparency doesn't change? Is it just not possible with textures
created from images? I've included code below.
Thanks,
Paula.
Appearance textureAppearance = new Appearance();
TransparencyAttributes transparency = new TransparencyAttributes(
TransparencyAttributes.NICEST, .85f);
PolygonAttributes polyAttrib = new PolygonAttributes();
polyAttrib.setCullFace(PolygonAttributes.CULL_BACK);
textureAppearance.setPolygonAttributes(polyAttrib);
TexCoordGeneration tcg = new
TexCoordGeneration(TexCoordGeneration.OBJECT_LINEAR,
TexCoordGeneration.TEXTURE_COORDINATE_2);
textureAppearance.setTexCoordGeneration(tcg);
String filename = texturefilepath.getAbsolutePath() + File.separatorChar +
texturename;
TextureLoader loader = new TextureLoader(filename, this);
ImageComponent2D image = loader.getScaledImage(1024, 1024);
Texture2D texture = new Texture2D(Texture.BASE_LEVEL, Texture.RGBA,
image.getWidth(),
image.getHeight());
texture.setImage(0, image);
texture.setEnable(true);
textureAppearance.setTexture(texture);
textureAppearance.setTransparencyAttributes(transparency);
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".