app.setPolygonAttributes(la); Material matt=new Material(); matt.setAmbientColor(new Color3f(1,1,1)); matt.setDiffuseColor(new Color3f(0.5f,0.5f,0.7f)); matt.setEmissiveColor(new Color3f(0.2f,0.2f,0.3f));
Material mat=new Material(); mat.setEmissiveColor(new Color3f(0.5f,0.5f,0.5f)); mat.setAmbientColor(new Color3f(0.1f,0.1f,0.1f)); mat.setDiffuseColor(new Color3f(0.2f,0.3f,0.4f)); mat.setSpecularColor(new Color3f(0.6f,0.3f,0.2f));
Material mat=new Material(); mat.setEmissiveColor(new Color3f(0.5f,0.5f,0.5f)); mat.setAmbientColor(new Color3f(0.1f,0.1f,0.1f)); mat.setDiffuseColor(new Color3f(0.2f,0.3f,0.4f)); mat.setSpecularColor(new Color3f(0.6f,0.3f,0.2f));
@Override public void readObject( DataInput in ) throws IOException { super.readObject( in ); Material attr = (Material)node; attr.setAmbientColor( control.readColor3f( in ) ); attr.setDiffuseColor( control.readColor3f( in ) ); attr.setEmissiveColor( control.readColor3f( in ) ); attr.setSpecularColor( control.readColor3f( in ) ); attr.setLightingEnable( in.readBoolean() ); attr.setColorTarget( in.readInt() ); }
target.setAmbientColor(newColor); break; case Material.AMBIENT_AND_DIFFUSE: target.setAmbientColor(newColor);
m.setAmbientColor(curColor.x, curColor.y, curColor.z) ; m.setDiffuseColor(curColor.x, curColor.y, curColor.z) ; m.setAmbientColor(curColor.x, curColor.y, curColor.z) ; m.setDiffuseColor(curColor.x, curColor.y, curColor.z, curColor.w) ;
m.setAmbientColor(curColor.x, curColor.y, curColor.z) ; m.setDiffuseColor(curColor.x, curColor.y, curColor.z) ; m.setAmbientColor(curColor.x, curColor.y, curColor.z) ; m.setDiffuseColor(curColor.x, curColor.y, curColor.z, curColor.w) ;
if (p.Ka != null) m.setAmbientColor(p.Ka); if (p.Kd != null) m.setDiffuseColor(p.Kd);
material.setAmbientColor(0.1f, 0.1f, 0.1f); material.setSpecularColor(0.5f, 0.5f, 0.5f); material.setDiffuseColor(0.1f, 0.1f, 0.1f);
protected Appearance createAppearance() { final Appearance appearance = new Appearance(); appearance.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_READ); final PolygonAttributes polyAttrib = new PolygonAttributes(); polyAttrib.setCapability(PolygonAttributes.ALLOW_MODE_WRITE); if (this.shaded) polyAttrib.setPolygonMode(PolygonAttributes.POLYGON_FILL); else polyAttrib.setPolygonMode(PolygonAttributes.POLYGON_LINE); polyAttrib.setCullFace(PolygonAttributes.CULL_NONE); polyAttrib.setBackFaceNormalFlip(true); appearance.setPolygonAttributes(polyAttrib); final ColoringAttributes colorAttrib = new ColoringAttributes(); colorAttrib.setShadeModel(ColoringAttributes.SHADE_GOURAUD); if (null != color) // is null when colors are vertex-wise colorAttrib.setColor(color); appearance.setColoringAttributes(colorAttrib); final TransparencyAttributes tr = new TransparencyAttributes(); final int mode = TransparencyAttributes.FASTEST; tr.setCapability(TransparencyAttributes.ALLOW_VALUE_WRITE); tr.setCapability(TransparencyAttributes.ALLOW_MODE_WRITE); tr.setTransparencyMode(mode); tr.setTransparency(transparency); appearance.setTransparencyAttributes(tr); final Material material = new Material(); material.setCapability(Material.ALLOW_COMPONENT_WRITE); material.setAmbientColor(0.1f, 0.1f, 0.1f); material.setSpecularColor(0.1f, 0.1f, 0.1f); material.setDiffuseColor(0.1f, 0.1f, 0.1f); appearance.setMaterial(material); return appearance; }
material.setAmbientColor(0.1f, 0.1f, 0.1f); material.setSpecularColor(0.1f, 0.1f, 0.1f); material.setDiffuseColor(0.1f, 0.1f, 0.1f);
material.setAmbientColor(0.1f, 0.1f, 0.1f); material.setSpecularColor(0.1f, 0.1f, 0.1f); material.setDiffuseColor(0.1f, 0.1f, 0.1f);
material.setAmbientColor(0.1f, 0.1f, 0.1f); material.setSpecularColor(0.1f, 0.1f, 0.1f); material.setDiffuseColor(0.1f, 0.1f, 0.1f);
material.setAmbientColor(0.1f, 0.1f, 0.1f); material.setSpecularColor(0.1f, 0.1f, 0.1f); material.setDiffuseColor(0.1f, 0.1f, 0.1f);