private void setColor (Appearance ap, Color c) { Material m = ap.getMaterial(); m.setAmbientColor(new Color3f(c)); m.setDiffuseColor(new Color3f(c)); float alpha = ((float)c.getAlpha()) / 255; if (alpha < 1.0) { TransparencyAttributes t = new TransparencyAttributes(); t.setTransparencyMode(TransparencyAttributes.BLENDED); t.setTransparency(1 - alpha); ap.setTransparencyAttributes(t); } else ap.setTransparencyAttributes(null); } }
/** * recupere la transparence de l'objet. */ public float getTransparence() { return shape_.getAppearance().getTransparencyAttributes().getTransparency(); }
ca.setColor((float) 1., (float) 1., (float) 1.); ca.setShadeModel(ColoringAttributes.NICEST); final TransparencyAttributes ta = new TransparencyAttributes(); ta.setCapability(TransparencyAttributes.ALLOW_VALUE_READ); ta.setCapability(TransparencyAttributes.ALLOW_VALUE_WRITE); ta.setTransparencyMode(TransparencyAttributes.NICEST); ta.setDstBlendFunction(TransparencyAttributes.BLEND_ZERO); final PointAttributes pointa = new PointAttributes(); pointa.setPointSize(pointa.getPointSize() * 2);
/** * modifie la transparence de l'objet. */ public void setTransparence(final float _t) { shape_.getAppearance().getTransparencyAttributes().setTransparency(_t); }
private void setColor (Appearance ap, Color c) { Material m = ap.getMaterial(); m.setAmbientColor(new Color3f(c)); m.setDiffuseColor(new Color3f(c)); float alpha = ((float)c.getAlpha()) / 255; if (alpha < 1.0) { TransparencyAttributes t = new TransparencyAttributes(); t.setTransparencyMode(TransparencyAttributes.BLENDED); t.setTransparency(1 - alpha); ap.setTransparencyAttributes(t); } else ap.setTransparencyAttributes(null); } }
if (app != null && app.getTransparencyAttributes() != null) { TransparencyAttributes tA = app.getTransparencyAttributes(); if (tA.getTransparency() > 0) { childGroup = new OrderedGroup(); if (app != null && app.getTransparencyAttributes() != null) { TransparencyAttributes tA = app.getTransparencyAttributes(); if (tA.getTransparency() > 0) { childGroup = new OrderedGroup();
TransparencyAttributes ta = new TransparencyAttributes(); ta.setTransparencyMode(TransparencyAttributes.BLEND_ZERO); ta.setTransparency(1.f - a); appearance.setTransparencyAttributes(ta);
TransparencyAttributes t = new TransparencyAttributes(); t.setTransparencyMode(TransparencyAttributes.BLENDED); t.setTransparency(1 - alpha); ap.setTransparencyAttributes(t);
TransparencyAttributes t = new TransparencyAttributes(); t.setTransparencyMode(TransparencyAttributes.BLENDED); t.setTransparency(1 - alpha); ap.setTransparencyAttributes(t);