Color3f red = new Color3f(1, 0, 0); Color3f yellow = new Color3f(0,1,1); Material lightGrayMaterial = new Material(lightGray, black, lightGray, white, 100.0f); Material blackMaterial = new Material(lightGray, black, black, lightGray, 10.0f); Material whiteMaterial = new Material(white, white, white, white, 100.0f); Material grayMaterial = new Material(gray, black, gray, gray, 100.0f); Material redMaterial = new Material(red, black, red, red, 100.0f); Material yellowMaterial = new Material(yellow, black, yellow, yellow, 100.0f);
Material mat = new Material();
Material mat = new Material();
Material mat = new Material();
Material mat = new Material();
Material mat = new Material(); mat.setDiffuseColor(r, g, b);
/** * 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; }
Color3f yellow = new Color3f(1,1,0); Material objMaterial = new Material(objColor, black, objColor, white, 100.0f); Material blackMaterial = new Material(objColor, black, black, objColor, 10.0f); Material whiteMaterial = new Material(white, white, white, white, 100.0f); Material grayMaterial = new Material(gray, black, gray, gray, 100.0f); Material redMaterial = new Material(red, black, red, red, 100.0f); Material yellowMaterial = new Material(yellow, black, yellow, yellow, 100); look.setMaterial(new Material(objColor, black, objColor, white, 100.0f)); Appearance blackLook = new Appearance();
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; }
Material material = new Material(col, black, col, specular, 64); material.setCapability(Material.ALLOW_COMPONENT_READ); material.setCapability(Material.ALLOW_COMPONENT_WRITE);
Material material = new Material(col, black, col, specular, 64); material.setCapability(Material.ALLOW_COMPONENT_READ); material.setCapability(Material.ALLOW_COMPONENT_WRITE);
pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); final Material m = new Material(); m.setCapability(Material.ALLOW_COMPONENT_READ); m.setCapability(Material.ALLOW_COMPONENT_WRITE);