0

さて、私の問題は、java3dにテクスチャがペイントされた平面があることです。このテクスチャは、アルファ透明度のある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 に答える