Hi all, i would like to know how to create a transparency texture on plane.I just arrived to make a plane transparent, but not the Texture2D .
This is my piece of code :
public class Plane2D extends TransformGroup {
private static final TextureLoader tl;
private static final Material mat;
private static final TransparencyAttributes ta;
private com.xith3d.scenegraph.Texture2D textureCube = null;
private com.xith3d.loaders.texture.TextureLoader tloalder = new com.xith3d.loaders.texture.TextureLoader();
static{
tl = new TextureLoader();
mat = new Material();
mat.setLightingEnable(false);
ta = new TransparencyAttributes(TransparencyAttributes.BLENDED, 0.5f);
}
public Plane2D(String text, String PATH) {
super();
tloalder.registerPath(PATH);
textureCube = (com.xith3d.scenegraph.Texture2D)tloalder.getMinMapTexture("model/"+text);
Appearance app = new Appearance();
app.setMaterial(mat);
app.setTexture(textureCube);
app.setTransparencyAttributes(ta);
Billboard billboard = new Billboard(GeometryArray.COORDINATES | GeometryArray.TEXTURE_COORDINATE_2, (float)textureCube.getWidth()/100f , (float) textureCube.getHeight()/100f);
this.addChild(new Shape3D(billboard, app));
}
}
Thanks for help 