/** * Change the transparency of this surface plot. * * @param t */ public void setTransparency(final float t) { final TransparencyAttributes tr = appearance.getTransparencyAttributes(); final int mode = t == 0f ? TransparencyAttributes.NONE : TransparencyAttributes.FASTEST; tr.setTransparencyMode(mode); tr.setTransparency(t); }
@Override public void setTransparency(final float transparency) { final TransparencyAttributes ta = getAppearance().getTransparencyAttributes(); if (transparency <= .01f) { this.transparency = 0.0f; ta.setTransparencyMode(TransparencyAttributes.NONE); } else { this.transparency = transparency; ta.setTransparencyMode(TransparencyAttributes.FASTEST); } ta.setTransparency(this.transparency); }
public void setTransparency(final float transparency) { final TransparencyAttributes ta = getAppearance().getTransparencyAttributes(); if (transparency <= .01f) { this.transparency = 0.0f; ta.setTransparencyMode(TransparencyAttributes.NONE); } else { this.transparency = transparency; ta.setTransparencyMode(TransparencyAttributes.FASTEST); } ta.setTransparency(this.transparency); }
/** * Sets the 6DOF sensor echo transparency. The default is opaque. A * value of 0.0 is fully opaque and 1.0 is fully transparent. This can be * called to set the transparency before or after the echo geometry is * created. * * @param transparency the transparency value */ public void setEchoTransparency(float transparency) { echoTransparency = transparency ; if (echoGeometry != null) { Appearance a = echoGeometry.getAppearance() ; TransparencyAttributes ta = a.getTransparencyAttributes() ; if (echoTransparency == 0.0f) { ta.setTransparencyMode(TransparencyAttributes.NONE) ; ta.setTransparency(0.0f) ; } else { ta.setTransparencyMode(TransparencyAttributes.BLENDED) ; ta.setTransparency(echoTransparency) ; // Use order independent additive blend for gnomon. if (echoGeometry instanceof SensorGnomonEcho) ta.setDstBlendFunction(TransparencyAttributes.BLEND_ONE) ; } } }
TransparencyAttributes ta = a.getTransparencyAttributes() ; ta.setTransparencyMode(TransparencyAttributes.BLENDED) ; ta.setTransparency(echoTransparency) ;
public AppearanceState( SymbolTableData symbol, Controller control ) { super(symbol, control); if (node!=null) { // Node is null during load Appearance app = (Appearance)node; polygonAttributes = control.getSymbolTable().addReference( app.getPolygonAttributes() ); renderingAttributes = control.getSymbolTable().addReference( app.getRenderingAttributes() ); coloringAttributes = control.getSymbolTable().addReference( app.getColoringAttributes() ); lineAttributes = control.getSymbolTable().addReference( app.getLineAttributes() ); material = control.getSymbolTable().addReference( app.getMaterial() ); pointAttributes = control.getSymbolTable().addReference( app.getPointAttributes() ); texCoordGeneration = control.getSymbolTable().addReference( app.getTexCoordGeneration() ); texture = control.getSymbolTable().addReference( app.getTexture() ); textureAttributes = control.getSymbolTable().addReference( app.getTextureAttributes() ); TextureUnitState[] texUnitState = app.getTextureUnitState(); if (texUnitState!=null) { textureUnitState = new int[ texUnitState.length ]; for(int i=0; i<texUnitState.length; i++) textureUnitState[i] = control.getSymbolTable().addReference( texUnitState[i] ); } else textureUnitState = new int[ 0 ]; transparencyAttributes = control.getSymbolTable().addReference( app.getTransparencyAttributes() ); } }