/** * mode ombr ou pas. */ public void setEclairage(final boolean _valeur) { shape_.getAppearance().getMaterial().setLightingEnable(_valeur); }
mat.setShininess(20.f); mat.setLightingEnable(true); a.setMaterial(mat);
mat.setShininess(20.f); mat.setLightingEnable(true); a.setMaterial(mat);
mat.setLightingEnable(true); a.setMaterial(mat);
mat.setLightingEnable(true);
mat.setLightingEnable(true); a.setMaterial(mat); } else {
/** * 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; }
material.setCapability(Material.ALLOW_COMPONENT_READ); material.setCapability(Material.ALLOW_COMPONENT_WRITE); material.setLightingEnable(true); ap.setMaterial(material);
material.setCapability(Material.ALLOW_COMPONENT_READ); material.setCapability(Material.ALLOW_COMPONENT_WRITE); material.setLightingEnable(true); ap.setMaterial(material);
m.setCapability(Material.ALLOW_COMPONENT_WRITE); m.setShininess(2); m.setLightingEnable(false); final TextureAttributes texa = new TextureAttributes(); texa.setCapability(TextureAttributes.ALLOW_MODE_WRITE);