public static Color3f parseColor3f(String color) { try { StringTokenizer s = new StringTokenizer(color, ","); return new Color3f(new float[] {Float.parseFloat(s.nextToken()), Float.parseFloat(s.nextToken()), Float.parseFloat(s.nextToken())}); } catch (Exception e) { return null; } }
public YoAppearanceRGBColor(Color color, double transparency) { this.color = new Color3f(color); awtColor = new Color(color.getRed() / 255.0f, color.getGreen() / 255.0f, color.getBlue() / 255.0f, (float) (1.0 - transparency)); setTransparency(transparency); }
public void setIntensite(final double _intensite) { intensite_ = _intensite; float red, green, blue; red = (float) (couleur_.getRed() * intensite_ / 255); green = (float) (couleur_.getGreen() * intensite_ / 255); blue = (float) (couleur_.getBlue() * intensite_ / 255); try { l_.setColor(new Color3f(red, green, blue)); } catch (final Exception ex) {} }
public YoAppearanceRGBColor(double red, double green, double blue, double transparency) { color = new Color3f((float) red, (float) green, (float) blue); awtColor = new Color((float) red, (float) green, (float) blue, (float) (1.0 - transparency)); setTransparency(transparency); }
public YoAppearanceRGBColor(Color color, double transparency) { this.color = new Color3f(color); awtColor = new Color(color.getRed() / 255.0f, color.getGreen() / 255.0f, color.getBlue() / 255.0f, (float) (1.0 - transparency)); setTransparency(transparency); }
public YoAppearanceRGBColor(float red, float green, float blue, double transparency) { color = new Color3f(red, green, blue); awtColor = new Color(red, green, blue, (float) (1.0 - transparency)); setTransparency(transparency); }
/** * Fixe la couleur du fond. */ public void setBackground(final Color _c) { background_.setColor(new Color3f(_c)); // getCanvas3D().waitForSwap(); }
public YoAppearanceRGBColor(float red, float green, float blue, double transparency) { color = new Color3f(red, green, blue); awtColor = new Color(red, green, blue, (float) (1.0 - transparency)); setTransparency(transparency); }
public YoAppearanceRGBColor(double red, double green, double blue, double transparency) { color = new Color3f((float) red, (float) green, (float) blue); awtColor = new Color((float) red, (float) green, (float) blue, (float) (1.0 - transparency)); setTransparency(transparency); }
public void run() { transparency += 0.01; if (transparency > 1.0) transparency = 0.0; Color3f color = new Color3f((float) Math.random(), (float) Math.random(), (float) Math.random()); YoAppearanceRGBColor appearance = new YoAppearanceRGBColor(color, 0.0); appearance.setTransparency(transparency); instruction.setAppearance(appearance); }
public void run() { transparency += 0.01; if (transparency > 1.0) transparency = 0.0; Color3f color = new Color3f((float) Math.random(), (float) Math.random(), (float) Math.random()); YoAppearanceRGBColor appearance = new YoAppearanceRGBColor(color, 0.0); appearance.setTransparency(transparency); instruction.setAppearance(appearance); }
public Color getBackground() { Color3f c3f = new Color3f(); background_.getColor(c3f); return c3f.get(); }
public static void addFog (Color col, double frontDistance, double backDistance) { LinearFog fog = new LinearFog(new Color3f(col), frontDistance, backDistance); fog.setInfluencingBounds(INFINITE_BOUNDS); BranchGroup bg = createBranchGroup(); bg.addChild(fog); fogGroup.addChild(bg); }
public static void addFog (Color col, double frontDistance, double backDistance) { LinearFog fog = new LinearFog(new Color3f(col), frontDistance, backDistance); fog.setInfluencingBounds(INFINITE_BOUNDS); BranchGroup bg = createBranchGroup(); bg.addChild(fog); fogGroup.addChild(bg); }
public YoAppearanceRGBColor(Color3f color, double transparency) { this.color = new Color3f(color); awtColor = new Color(this.color.getX(), this.color.getY(), this.color.getZ(), (float) (1.0 - transparency)); setTransparency(transparency); }
public YoAppearanceRGBColor(Color3f color, double transparency) { this.color = new Color3f(color); awtColor = new Color(this.color.getX(), this.color.getY(), this.color.getZ(), (float) (1.0 - transparency)); setTransparency(transparency); }
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); } }
/** * renvoie la couleur de l'objet. */ public Color getCouleur() { final Color3f couleur = new Color3f(); shape_.getAppearance().getColoringAttributes().getColor(couleur); return couleur.get(); }
public void setRoot(final BGroupeStandard _root) { buildFond(new Color3f(Color.WHITE)); if (groupe_ != null) { getLocale().removeBranchGraph(volumes_); getLocale().removeBranchGraph(lumieres_); } groupe_ = _root; volumes_ = _root.getGroupeVolume(); lumieres_ = _root.getGroupeLumiere(); addBranchGraph(volumes_); addBranchGraph(lumieres_); }