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();
/** * @deprecated replaced with cloneNodeComponent(boolean forceDuplicate) */ @Override public NodeComponent cloneNodeComponent() { PolygonAttributes pga = new PolygonAttributes(); pga.duplicateNodeComponent(this); return pga; }
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; }
// Because we're about to spin this triangle, be sure to draw // backfaces. If we don't, the back side of the triangle is invisible. Appearance ap = new Appearance(); PolygonAttributes pa = new PolygonAttributes(); pa.setCullFace(PolygonAttributes.CULL_NONE); ap.setPolygonAttributes(pa); shape.setAppearance(ap);
public Appearance createTextAppearance() { final Appearance textAppear = new Appearance(); final ColoringAttributes textColor = new ColoringAttributes(); textColor.setColor(color); textAppear.setColoringAttributes(textColor); final PolygonAttributes pa = new PolygonAttributes(); pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); textAppear.setPolygonAttributes(pa); return textAppear; }
@Override public void readObject( DataInput in ) throws IOException { super.readObject( in ); PolygonAttributes polyAttr = (PolygonAttributes)node; polyAttr.setBackFaceNormalFlip( in.readBoolean() ); polyAttr.setCullFace( in.readInt() ); polyAttr.setPolygonMode( in.readInt() ); polyAttr.setPolygonOffset( in.readFloat() ); polyAttr.setPolygonOffsetFactor( in.readFloat() ); }
pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); mesh.setColor(c3); pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); extra.setColor(extra_triangle_colors);
@Override protected org.scijava.java3d.SceneGraphObject createNode() { return new PolygonAttributes(); }
/** * Shade the surface or not. * * @param b */ public void setShaded(final boolean b) { final PolygonAttributes pa = appearance.getPolygonAttributes(); if (b) pa.setPolygonMode(PolygonAttributes.POLYGON_FILL); else pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); }
@Override public void writeObject( DataOutput out ) throws IOException { super.writeObject( out ); PolygonAttributes polyAttr = (PolygonAttributes)node; out.writeBoolean( polyAttr.getBackFaceNormalFlip() ); out.writeInt( polyAttr.getCullFace() ); out.writeInt( polyAttr.getPolygonMode() ); out.writeFloat( polyAttr.getPolygonOffset() ); out.writeFloat( polyAttr.getPolygonOffsetFactor() ); }
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);
transAttr.setTransparency(transparency); polyAttr = new PolygonAttributes(); polyAttr.setCullFace(PolygonAttributes.CULL_NONE);
textAppear.setColoringAttributes(textColor); final PolygonAttributes pa = new PolygonAttributes(); pa.setCullFace(PolygonAttributes.CULL_NONE); pa.setBackFaceNormalFlip(true); textAppear.setPolygonAttributes(pa);
BranchGroup group = new BranchGroup(); //Content branch. PolygonAttributes p = new PolygonAttributes(); //Not sure how to make it transparent/try code above. Appearance planeAppearance = new Appearance(); planeAppearance.setPolygonAttributes (p); Color3f planeColor = new Color3f (1.0f, 1.0f, 1.0f); //This makes it white. ColoringAttributes planeCA = new ColoringAttributes (planeColor, 1); planeAppearance.setColoringAttributes(planeCA); QuadArray plane = new QuadArray (4, QuadArray.COORDINATES); //This makes the plane. plane.setCoordinate(0, new Point3f(-5f, -5f, -15f)); //You specify your own cornerpoints... plane.setCoordinate(1, new Point3f(5f, -5f, -15f)); plane.setCoordinate(2, new Point3f(5f, 5f, -15f)); plane.setCoordinate(3, new Point3f(-5f, 5f, -15f)); group.addChild(new Shape3D(plane, planeAppearance)); //Add plane to content branch.
public void setShaded(final boolean b) { this.shaded = b; final PolygonAttributes pa = getAppearance().getPolygonAttributes(); if (b) pa.setPolygonMode(PolygonAttributes.POLYGON_FILL); else pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); }
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);
lsa.setCoordinates(0, pts); Shape3D sh=new Shape3D(); PolygonAttributes pa=new PolygonAttributes(); pa.setPolygonMode(PolygonAttributes.POLYGON_FILL); pa.setCullFace(PolygonAttributes.CULL_NONE); Material mat=new Material(); mat.setEmissiveColor(new Color3f(0.5f,0.5f,0.5f));
transAttr.setTransparency(transparency); polyAttr = new PolygonAttributes(); polyAttr.setCullFace(PolygonAttributes.CULL_NONE);
@Override public void setShaded(final boolean b) { this.shaded = b; final PolygonAttributes pa = getAppearance().getPolygonAttributes(); if (b) pa.setPolygonMode(PolygonAttributes.POLYGON_FILL); else pa.setPolygonMode(PolygonAttributes.POLYGON_LINE); }
app.setCapability(Appearance.ALLOW_TRANSPARENCY_ATTRIBUTES_READ); final PolygonAttributes polyAttrib = new PolygonAttributes(); polyAttrib.setCapability(PolygonAttributes.ALLOW_MODE_WRITE); polyAttrib.setPolygonMode(PolygonAttributes.POLYGON_FILL); polyAttrib.setCullFace(PolygonAttributes.CULL_NONE); polyAttrib.setBackFaceNormalFlip(true); app.setPolygonAttributes(polyAttrib);