Refine search
Appearance app = new Appearance(); ColoringAttributes ca = new ColoringAttributes(new Color3f(204.0f, 204.0f,204.0f), ColoringAttributes.SHADE_FLAT); app.setColoringAttributes(ca); Point3f[] plaPts = new Point3f[5]; for (int i = 0; i < 2; i++) { a_point_just_bigger.setPointSize(10.0f);//10 pixel-wide point a_point_just_bigger.setPointAntialiasingEnable(true);//now points are sphere-like(not a cube) app.setPointAttributes(a_point_just_bigger); PolygonAttributes la=new PolygonAttributes(); la.setPolygonMode(PolygonAttributes.POLYGON_FILL); la.setCullFace(PolygonAttributes.CULL_NONE); 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)); matt.setShininess(0.5f); matt.setSpecularColor(new Color3f(0.4f,0.6f,0.9f)); matt.setLightingEnable(true); app.setMaterial(matt);
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; }
public Appearance createAppearance() { Appearance appearance = new Appearance(); texAttr.setCombineRgbMode(TextureAttributes.COMBINE_MODULATE); texAttr.setPerspectiveCorrectionMode(TextureAttributes.NICEST); appearance.setTextureAttributes(texAttr); transAttr.setCapability(TransparencyAttributes.ALLOW_VALUE_WRITE); transAttr.setTransparencyMode(TransparencyAttributes.BLENDED); appearance.setTransparencyAttributes(transAttr); appearance.setPolygonAttributes(polyAttr); Material material = new Material(); material.setLightingEnable(false); appearance.setMaterial(material);
Material m = new Material(); p = (ObjectFileMaterial)materials.get(matName); Appearance a = new Appearance(); if (p.Ka != null) m.setAmbientColor(p.Ka); if (p.Kd != null) m.setDiffuseColor(p.Kd); if ((p.Ks != null) && (p.illum != 1)) m.setSpecularColor(p.Ks); 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); if (p.Ns != -1.0f) m.setShininess(p.Ns); a.setTexture(p.t); a.setTexCoordGeneration(tcg);
Material m = new Material() ; m.setCapability(Material.ALLOW_COMPONENT_READ) ; m.setCapability(Material.ALLOW_COMPONENT_WRITE) ; m.setLightingEnable(true) ; m.setLightingEnable(false) ; tsa.setNormals(0, normals) ; Appearance a = new Appearance() ; a.setMaterial(m) ; a.setCapability(Appearance.ALLOW_MATERIAL_READ) ; a.setCapability(Appearance.ALLOW_MATERIAL_WRITE) ;
Appearance appearance = new Appearance(); if (shape.facetSizes[0] == 1) { pointStyle.setPointSize(1); appearance.setColoringAttributes(colorAtt); appearance.setPointAttributes(pointStyle); Material material = new Material(surf.getColor(), surf.getEmissiveColor(), surf.getDiffuseColor(), surf.getSpecularColor(), surf.getShininess()); material.setLightingEnable(true); appearance.setMaterial(material); if (surf.getTransparency() != 0f) {
Material m = new Material() ; 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.setLightingEnable(false) ; else m.setLightingEnable(true) ; Appearance a = new Appearance() ; a.setMaterial(m) ;
/** * 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; }
Appearance appearance = new Appearance(); Material material = new Material(); material.setDiffuseColor(1.0f, 0.0f, 0.0f); // red material.setSpecularColor(0.2f, 0.2f, 0.2f); // reduce default values appearance.setMaterial(material);
/** * Create a default Appearance object using the specified color. * * @param color */ private void initAppearance(final Color3f color) { appearance = new Appearance(); appearance.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_READ); final ColoringAttributes colorAttrib = new ColoringAttributes(); colorAttrib.setShadeModel(ColoringAttributes.SHADE_GOURAUD); colorAttrib.setColor(color); colorAttrib.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE); appearance.setColoringAttributes(colorAttrib); final Material material = new Material(); material.setDiffuseColor(color); appearance.setMaterial(material); }
@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); }
if (target.getCapability(Material.ALLOW_COMPONENT_READ)) colorTarget = target.getColorTarget(); target.setAmbientColor(newColor); break; case Material.AMBIENT_AND_DIFFUSE: target.setAmbientColor(newColor); target.setDiffuseColor(newColor); break; case Material.EMISSIVE: target.setEmissiveColor(newColor); break; case Material.SPECULAR: target.setSpecularColor(newColor); break;
StringBuffer str = new StringBuffer(getNamePrefix()); str.append("org.scijava.java3d.Material: "); Color3f color=new Color3f(); try { getAmbientColor(color); str.append("AmbientColor="+color); } catch (CapabilityNotSetException e) {str.append("AmbientColor=N/A");} try { getEmissiveColor(color); str.append(" EmissiveColor="+color); } catch (CapabilityNotSetException ex) {str.append(" EmissiveColor=N/A");} try { getDiffuseColor(color); str.append(" DiffuseColor="+color); } catch (CapabilityNotSetException exc) {str.append(" DiffuseColor=N/A");} try { getSpecularColor(color); str.append(" SpecularColor="+color); } catch (CapabilityNotSetException exce) {str.append(" SpecularColor=N/A");} try { float f=getShininess(); str.append(" Shininess="+f); } catch (CapabilityNotSetException excep) {str.append(" Shininess=N/A");} try { boolean b=getLightingEnable(); str.append(" LightingEnable="+b); } catch (CapabilityNotSetException except) {str.append(" LightingEnable=N/A");} try { int i=getColorTarget();
mSphere = new Sphere(1, 24, 24); Material material = new Material(); mSphere.setMaterial(material); mSphere.setDrawingMode(GLES20.GL_LINES); getCurrentScene().addChild(mSphere);
@Override public void writeObject( DataOutput out ) throws IOException { super.writeObject( out ); Material attr = (Material)node; Color3f clr = new Color3f(); attr.getAmbientColor( clr ); control.writeColor3f( out, clr ); attr.getDiffuseColor( clr ); control.writeColor3f( out, clr ); attr.getEmissiveColor( clr ); control.writeColor3f( out, clr ); attr.getSpecularColor( clr ); control.writeColor3f( out, clr ); out.writeBoolean( attr.getLightingEnable() ); out.writeInt( attr.getColorTarget() ); }
polyAttr.setCullFace(PolygonAttributes.CULL_NONE); material = new Material(); material.setLightingEnable(true);
Material material = new Material(); material.setColorInfluence(0); try { material.addTexture(mVideoTexture); } catch (ATexture.TextureException e) { e.printStackTrace();
final Material material = new Material(); material.setColor(0); material.setColorInfluence(0f); try { material.addTexture(mStreamingTexture); } catch (ATexture.TextureException e) { e.printStackTrace();
streamingTexture = new StreamingTexture("video", mediaPlayer); Material material = new Material(); material.setColor(0); try { material.addTexture(texture); } catch (ATexture.TextureException e) { throw new RuntimeException(e); } Sphere sphere = new Sphere(50, 64, 32); sphere.setScaleX(-1); sphere.setMaterial(material); getCurrentScene().addChild(sphere);