2010-09-25 173 views
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); 

任何幫助,將不勝感激

回答

0

如果你不希望任何透明度可言您的任何紋理,試試這個:

TransparencyAttributes tAttr = new TransparencyAttributes(); 
tAttr.setTransparencyMode(NONE); 
ap.setTransparencyAttributes(tAttr);