0
好的,所以我的问题是,我有一个java3d有一个飞机上绘有纹理。这个纹理是一个alpha透明的PNG。渲染场景时,平面上的纹理部分是半透明的,就好像它在整个图像上具有一些透明度。我打了周围的各种质地和透明度设置设法得到它的工作设置透明度使纹理半透明
Appearance ap = new Appearance();
TextureLoader tl = new TextureLoader(textImage);
Texture tex = tl.getTexture();
TextureAttributes ta = new TextureAttributes();
ta.setTextureMode(TextureAttributes.MODULATE);
TransparencyAttributes transat = new TransparencyAttributes();
transat.setTransparencyMode(TransparencyAttributes.BLENDED);
transat.setTransparency(0f);
ap.setTextureAttributes(ta);
ap.setTexture(tex);
ap.setTransparencyAttributes(transat);
shape.setAppearance(ap);
任何帮助,将不胜感激