/** * 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; }
/** * l'objet est affich en fil de fer? */ public boolean isFilaire() { return (shape_.getAppearance().getPolygonAttributes().getPolygonMode() == PolygonAttributes.POLYGON_LINE); }
PolygonAttributes pa = new PolygonAttributes(); pa.setCullFace(PolygonAttributes.CULL_NONE); // see both sides of shape pa.setPolygonMode(PolygonAttributes.POLYGON_FILL); pa.setBackFaceNormalFlip(true); pa.setPolygonOffset(polygonOffset); pa.setPolygonOffsetFactor(polygonOffset); appearance.setPolygonAttributes(pa);
private static Appearance createCustomAppearance (boolean fill) { Appearance ap = createBlankAppearance(); PolygonAttributes pa = new PolygonAttributes(); if (!fill) pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); LineAttributes la = new LineAttributes(); la.setLineWidth(penRadius); la.setLineAntialiasingEnable(view.getSceneAntialiasingEnable()); PointAttributes poa = new PointAttributes(); poa.setPointAntialiasingEnable(view.getSceneAntialiasingEnable()); ap.setPolygonAttributes(pa); ap.setLineAttributes(la); ap.setPointAttributes(poa); Color3f col = new Color3f(penColor); Color3f black = new Color3f(0, 0, 0); Color3f specular = new Color3f(GRAY); // Material properties Material material = new Material(col, black, col, specular, 64); material.setCapability(Material.ALLOW_COMPONENT_READ); material.setCapability(Material.ALLOW_COMPONENT_WRITE); material.setLightingEnable(true); ap.setMaterial(material); return ap; }
Appearance ap = shape.getAppearance(); PolygonAttributes pa = ap.getPolygonAttributes(); if (pa == null) pa = new PolygonAttributes(); pa.setCullFace(PolygonAttributes.CULL_NONE); ap.setPolygonAttributes(pa);
/** * affiche l'objet en fil de fer. */ public void setFilaire(final boolean _filaire) { if (_filaire) { shape_.getAppearance().getPolygonAttributes().setPolygonMode(PolygonAttributes.POLYGON_LINE); } else { shape_.getAppearance().getPolygonAttributes().setPolygonMode(PolygonAttributes.POLYGON_FILL); } }
private static Appearance createCustomAppearance (boolean fill) { Appearance ap = createBlankAppearance(); PolygonAttributes pa = new PolygonAttributes(); if (!fill) pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); LineAttributes la = new LineAttributes(); la.setLineWidth(penRadius); la.setLineAntialiasingEnable(view.getSceneAntialiasingEnable()); PointAttributes poa = new PointAttributes(); poa.setPointAntialiasingEnable(view.getSceneAntialiasingEnable()); ap.setPolygonAttributes(pa); ap.setLineAttributes(la); ap.setPointAttributes(poa); Color3f col = new Color3f(penColor); Color3f black = new Color3f(0, 0, 0); Color3f specular = new Color3f(GRAY); // Material properties Material material = new Material(col, black, col, specular, 64); material.setCapability(Material.ALLOW_COMPONENT_READ); material.setCapability(Material.ALLOW_COMPONENT_WRITE); material.setLightingEnable(true); ap.setMaterial(material); return ap; }
Appearance ap = shape.getAppearance(); PolygonAttributes pa = ap.getPolygonAttributes(); if (pa == null) pa = new PolygonAttributes(); pa.setCullFace(PolygonAttributes.CULL_NONE); ap.setPolygonAttributes(pa);
PolygonAttributes pa = new PolygonAttributes(); pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); a.setPolygonAttributes(pa);
PolygonAttributes pa = new PolygonAttributes(); if (!fill) pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); ap.setPolygonAttributes(pa);
PolygonAttributes pa = new PolygonAttributes(); pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); // see both sides of shape pa.setBackFaceNormalFlip(true); a.setPolygonAttributes(pa);
PolygonAttributes pa = new PolygonAttributes(); if (!fill) pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); ap.setPolygonAttributes(pa);
/** * Returns a solid appearance. * @return the appearance */ private Appearance getColoredAppearance() { Appearance a = new Appearance(); PolygonAttributes pa = new PolygonAttributes(); pa.setCullFace(PolygonAttributes.CULL_NONE); // see both sides of shape pa.setPolygonMode(PolygonAttributes.POLYGON_FILL); pa.setBackFaceNormalFlip(true); a.setPolygonAttributes(pa); LineAttributes la = new LineAttributes(); la.setLineAntialiasingEnable(true); la.setLineWidth(1.f); a.setLineAttributes(la); Material mat = new Material(); mat.setSpecularColor(1.f, 1.f, 0.8f); mat.setDiffuseColor(1.f, 0.4f, 0.1f); mat.setShininess(20.f); mat.setLightingEnable(true); a.setMaterial(mat); return a; }
int vertexColoringType) { Appearance a = new Appearance(); PolygonAttributes pa = new PolygonAttributes(); pa.setPolygonMode(PolygonAttributes.POLYGON_POINT); pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); a.setPolygonAttributes(pa);
bbox_.getUpper(up); final PolygonAttributes pa = new PolygonAttributes(); pa.setCapability(PolygonAttributes.ALLOW_MODE_READ); pa.setCapability(PolygonAttributes.ALLOW_MODE_WRITE); pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); final Appearance ap = new Appearance(); ap.setPolygonAttributes(pa);
Color color, Float lineWidth, boolean lighting, int vertexColoringType) { Appearance a = new Appearance(); PolygonAttributes pa = new PolygonAttributes(); pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); a.setPolygonAttributes(pa);
bbox_.getUpper(up); final PolygonAttributes pa = new PolygonAttributes(); pa.setCapability(PolygonAttributes.ALLOW_MODE_READ); pa.setCapability(PolygonAttributes.ALLOW_MODE_WRITE); pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); final ColoringAttributes ca = new ColoringAttributes(); ca.setColor(new Color3f(1f, 0f, 0f));
pointarray.setCapability(GeometryArray.ALLOW_COLOR_WRITE); shape_.setGeometry(pointarray); final PolygonAttributes pa = new PolygonAttributes(); pa.setCapability(PolygonAttributes.ALLOW_MODE_READ); pa.setCapability(PolygonAttributes.ALLOW_MODE_WRITE); pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); final Appearance ap = new Appearance(); ap.setPolygonAttributes(pa);
bbox_.getUpper(up); final PolygonAttributes pa= new PolygonAttributes(); pa.setCapability(PolygonAttributes.ALLOW_MODE_READ); pa.setCapability(PolygonAttributes.ALLOW_MODE_WRITE); pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); final ColoringAttributes ca= new ColoringAttributes(); ca.setColor(new Color3f(1f, 0f, 0f));
linearray.setCapability(GeometryArray.ALLOW_COORDINATE_READ); shape_.setGeometry(linearray); final PolygonAttributes pa = new PolygonAttributes(); pa.setCapability(PolygonAttributes.ALLOW_MODE_READ); pa.setCapability(PolygonAttributes.ALLOW_MODE_WRITE); pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); final Appearance ap = new Appearance(); ap.setPolygonAttributes(pa);