/** * Returns a wired appearance without lighting and anti-aliasing. * * @param color the color of the appearance * @param lineWidth the width of the lines (wires) * @return the appearance */ public Appearance getLinedAppearanceWithoutLighting(Color color, Float lineWidth) { Appearance a = new Appearance(); PolygonAttributes pa = new PolygonAttributes(); pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); a.setPolygonAttributes(pa); LineAttributes la = new LineAttributes(); la.setLineAntialiasingEnable(false); la.setLineWidth(lineWidth); a.setLineAttributes(la); float r = color.getRed() / 255.f; float g = color.getGreen() / 255.f; float b = color.getBlue() / 255.f; ColoringAttributes ca = new ColoringAttributes(r, g, b, ColoringAttributes.SHADE_FLAT); a.setColoringAttributes(ca); return a; }
/** * colore l'objet d'une couleur unique. */ public boolean setCouleur(final Color _c) { if (shape_ == null || shape_.getGeometry() == null) { return false; } isColorUsed_ = true; final int nbPts = ((GeometryArray) shape_.getGeometry()).getVertexCount(); shape_.getAppearance().getColoringAttributes().setColor(new Color3f(_c)); final Color4f[] cs = new Color4f[nbPts]; Arrays.fill(cs, new Color4f(_c)); ((GeometryArray) shape_.getGeometry()).setColors(0, cs); return true; }
/** * renvoie la couleur de l'objet. */ public Color getCouleur() { final Color3f couleur = new Color3f(); shape_.getAppearance().getColoringAttributes().getColor(couleur); return couleur.get(); }
poa.setPointAntialiasingEnable(view.getSceneAntialiasingEnable()); ColoringAttributes ca = new ColoringAttributes(); ca.setShadeModel(ColoringAttributes.SHADE_GOURAUD); ca.setColor(col);
shape_.setCapability(Shape3D.ALLOW_APPEARANCE_OVERRIDE_WRITE); switch_.addChild(shape_); final ColoringAttributes ca = new ColoringAttributes(); ca.setCapability(ColoringAttributes.ALLOW_COLOR_READ); ca.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE); ca.setCapability(ColoringAttributes.ALLOW_SHADE_MODEL_READ); ca.setCapability(ColoringAttributes.ALLOW_SHADE_MODEL_WRITE); ca.setColor((float) 1., (float) 1., (float) 1.); ca.setShadeModel(ColoringAttributes.NICEST); final TransparencyAttributes ta = new TransparencyAttributes(); ta.setCapability(TransparencyAttributes.ALLOW_VALUE_READ);
pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); final ColoringAttributes ca = new ColoringAttributes(); ca.setColor(new Color3f(1f, 0f, 0f)); final Appearance ap = new Appearance(); ap.setPolygonAttributes(pa);
poa.setPointAntialiasingEnable(view.getSceneAntialiasingEnable()); ColoringAttributes ca = new ColoringAttributes(); ca.setShadeModel(ColoringAttributes.SHADE_GOURAUD); ca.setColor(col);
pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); final ColoringAttributes ca= new ColoringAttributes(); ca.setColor(new Color3f(1f, 0f, 0f)); final Appearance ap= new Appearance(); ap.setPolygonAttributes(pa);
} else { a.setColoringAttributes( new ColoringAttributes(new Color3f(r, g, b), ColoringAttributes.NICEST));