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);

任何帮助,将不胜感激

4

1 回答 1

0

如果您根本不希望任何纹理具有任何透明度,请尝试以下操作:

TransparencyAttributes tAttr = new TransparencyAttributes();
tAttr.setTransparencyMode(NONE);
ap.setTransparencyAttributes(tAttr);
于 2011-04-27T22:11:32.980 回答