/** * 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; }
la.setLineAntialiasingEnable(true); la.setLineWidth(1.5f);
la.setLineAntialiasingEnable(true); la.setLineWidth(0.1f);
la.setLineAntialiasingEnable(true); la.setLineWidth(lineWidth);
/** * 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; }
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; }
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; }
la.setLineAntialiasingEnable(view.getSceneAntialiasingEnable());
la.setLineAntialiasingEnable(view.getSceneAntialiasingEnable());
pointa.setPointAntialiasingEnable(true); final LineAttributes la = new LineAttributes(); la.setLineAntialiasingEnable(true); final PolygonAttributes pa = new PolygonAttributes(); pa.setCapability(PolygonAttributes.ALLOW_MODE_READ);