RenderingAttributes ra=new RenderingAttributes(); ra.setIgnoreVertexColors(true); ColoringAttributes ca=new ColoringAttributes(); ca.setShadeModel(ColoringAttributes.SHADE_GOURAUD); ca.setColor(new Color3f(0.2f,0.5f,0.9f));
RenderingAttributes ra=new RenderingAttributes(); ra.setIgnoreVertexColors(true); ColoringAttributes ca=new ColoringAttributes(); ca.setShadeModel(ColoringAttributes.SHADE_GOURAUD); ca.setColor(new Color3f(0.2f,0.5f,0.9f));
@Override protected SceneGraphObject createNode() { return new ColoringAttributes(); }
/** * @deprecated replaced with cloneNodeComponent(boolean forceDuplicate) */ @Override public NodeComponent cloneNodeComponent() { ColoringAttributes ca = new ColoringAttributes(); ca.duplicateNodeComponent(this); return ca; }
Appearance appearanceGreen = new Appearance(); ColoringAttributes coloringAttributesGreen = new ColoringAttributes(); coloringAttributesGreen.setColor(new Color3f(Color.green)); appearanceGreen.setColoringAttributes(coloringAttributesGreen); Shape3D shapeLine = new Shape3D(lineX, appearanceGreen); scene.addChild(shapeLine);
private Appearance createAppearance(final Color3f color) { final Appearance a = new Appearance(); final PolygonAttributes pa = new PolygonAttributes(); pa.setPolygonMode(PolygonAttributes.POLYGON_FILL); pa.setCullFace(PolygonAttributes.CULL_NONE); a.setPolygonAttributes(pa); final ColoringAttributes ca = new ColoringAttributes(); ca.setColor(color); a.setColoringAttributes(ca); return a; }
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; }
/** * 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); }
public void addVertex(Image3DUniverse univ, Color3f color, float x, float y, float z) { BranchGroup bg = new BranchGroup(); bg.setCapability(BranchGroup.ALLOW_DETACH); TransformGroup tg = new TransformGroup(); Transform3D t3d = new Transform3D(); t3d.setTranslation(new Vector3f(x, y, z)); tg.setTransform(t3d); bg.addChild(tg); Appearance app = new Appearance(); ColoringAttributes cattr = new ColoringAttributes(); cattr.setColor(color); app.setColoringAttributes(cattr); tg.addChild(new Sphere(0.1f, app)); univ.getScene().addChild(bg); }
app.setPolygonAttributes(polyAttrib); final ColoringAttributes colorAttrib = new ColoringAttributes(); colorAttrib.setShadeModel(ColoringAttributes.SHADE_GOURAUD);
material.setLightingEnable(false); colAttr = new ColoringAttributes(); colAttr.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE); colAttr.setShadeModel(ColoringAttributes.NICEST);
final ColoringAttributes textColor = new ColoringAttributes(); textColor.setColor(color); textAppear.setColoringAttributes(textColor);
material.setLightingEnable(true); colAttr = new ColoringAttributes(); colAttr.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE); colAttr.setShadeModel(ColoringAttributes.NICEST);
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; }
appearance.setPolygonAttributes(polyAttrib); final ColoringAttributes colorAttrib = new ColoringAttributes(); colorAttrib.setShadeModel(ColoringAttributes.SHADE_GOURAUD); if (null != color) // is null when colors are vertex-wise
appearance.setPolygonAttributes(polyAttrib); final ColoringAttributes colorAttrib = new ColoringAttributes(); colorAttrib.setShadeModel(ColoringAttributes.SHADE_GOURAUD); if (null != color) // is null when colors are vertex-wise
ta.setTransparencyMode(TransparencyAttributes.FASTEST); appearance.setTransparencyAttributes(ta); ca = new ColoringAttributes(); ca.setColor(color); appearance.setColoringAttributes(ca);
appearance.setMaterial(material); ColoringAttributes colAttr = new ColoringAttributes(); colAttr.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE); colAttr.setShadeModel(ColoringAttributes.NICEST);
appearance.setMaterial(material); ColoringAttributes colAttr = new ColoringAttributes(); colAttr.setCapability(ColoringAttributes.ALLOW_COLOR_WRITE); colAttr.setShadeModel(ColoringAttributes.NICEST);
appearance.setPolygonAttributes(polyAttrib); final ColoringAttributes colorAttrib = new ColoringAttributes(); colorAttrib.setShadeModel(ColoringAttributes.SHADE_GOURAUD); colorAttrib.setColor(color);