matt.setShininess(0.5f); matt.setSpecularColor(new Color3f(0.4f,0.6f,0.9f)); matt.setLightingEnable(true);
mat.setDiffuseColor(new Color3f(0.2f,0.3f,0.4f)); mat.setSpecularColor(new Color3f(0.6f,0.3f,0.2f)); mat.setLightingEnable(true); RenderingAttributes ra=new RenderingAttributes(); ra.setIgnoreVertexColors(true);
mat.setDiffuseColor(new Color3f(0.2f,0.3f,0.4f)); mat.setSpecularColor(new Color3f(0.6f,0.3f,0.2f)); mat.setLightingEnable(true); RenderingAttributes ra=new RenderingAttributes(); ra.setIgnoreVertexColors(true);
@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() ); }
/** Sets the main appearance of the primitive (all subparts) to * a default white appearance. */ public void setAppearance(){ Color3f aColor = new Color3f(0.1f, 0.1f, 0.1f); Color3f eColor = new Color3f(0.0f, 0.0f, 0.0f); Color3f dColor = new Color3f(0.6f, 0.6f, 0.6f); Color3f sColor = new Color3f(1.0f, 1.0f, 1.0f); Material m = new Material(aColor, eColor, dColor, sColor, 100.0f); Appearance a = new Appearance(); m.setLightingEnable(true); a.setMaterial(m); setAppearance(a); }
m.setLightingEnable(false) ; else m.setLightingEnable(true) ;
m.setLightingEnable(false) ; else m.setLightingEnable(true) ;
else if (p.illum == 1) m.setSpecularColor(0.0f, 0.0f, 0.0f); if (p.illum >= 1) m.setLightingEnable(true); else if (p.illum == 0) m.setLightingEnable(false);
/** * Creates Appearance for this Shape3D. This sets transparency * for the object (we want the text to be "floating" in space, * so only the text itself should be non-transparent. Also, the * appearance disables lighting for the object; the text will * simply be colored, not lit. */ private Appearance setupAppearance(Texture2D t2d) { Appearance appearance = getAppearance(); if (appearance == null) { TransparencyAttributes transp = new TransparencyAttributes(); transp.setTransparencyMode(TransparencyAttributes.BLENDED); transp.setTransparency(0f); appearance = new Appearance(); appearance.setTransparencyAttributes(transp); appearance.setTexture(t2d); Material m = new Material(); m.setLightingEnable(false); appearance.setMaterial(m); appearance.setCapability(Appearance.ALLOW_TEXTURE_WRITE); appearance.setCapability(Appearance.ALLOW_TEXTURE_READ); appearance.setCapabilityIsFrequent(Appearance.ALLOW_TEXTURE_READ); }else{ appearance.setTexture(t2d); } return appearance; }
material.setLightingEnable(false);
material.setLightingEnable(true);
surf.getSpecularColor(), surf.getShininess()); material.setLightingEnable(true); appearance.setMaterial(material); if (surf.getTransparency() != 0f) {
vertexFormat = GeometryArray.COORDINATES | GeometryArray.NORMALS ; m.setLightingEnable(true) ; m.setLightingEnable(false) ;
material.setLightingEnable(false); appearance.setMaterial(material);
material.setLightingEnable(false); appearance.setMaterial(material);
vertexFormat = GeometryArray.COORDINATES | GeometryArray.NORMALS ; m.setLightingEnable(true) ; m.setLightingEnable(false) ;