Package javax.media.j3d

Examples of javax.media.j3d.ColoringAttributes


        Appearance materialAppear = new Appearance();
        PolygonAttributes polyAttrib = new PolygonAttributes();
        polyAttrib.setPolygonMode(PolygonAttributes.POLYGON_LINE);
        materialAppear.setPolygonAttributes(polyAttrib);
        ColoringAttributes redColoring = new ColoringAttributes();
        redColoring.setColor(1.0f, 0.0f, 0.0f);
        materialAppear.setColoringAttributes(redColoring);

        return materialAppear;
    }
View Full Code Here


    Appearance sphereApp = new Appearance();

    sphereApp.setMaterial(new Material(ambientColourSphere,emissiveColourSphere,
                           diffuseColourSphere,specularColourSphere,shininessSphere));

    ColoringAttributes ca = new ColoringAttributes();
    ca.setShadeModel(ColoringAttributes.SHADE_FLAT);
    sphereApp.setColoringAttributes(ca);


    //n spheres with radius r will be shown.
    int n = 5;
View Full Code Here

        // Deal with flat attribute.
        boolean flatValue = ((BooleanToken) flat.getToken()).booleanValue();

        if (flatValue) {
            _coloringAttributes = new ColoringAttributes(0.7f, 0.7f, 0.7f,
                    ColoringAttributes.SHADE_FLAT);
            _appearance.setColoringAttributes(_coloringAttributes);
        } else if (allowChanges) {
            _coloringAttributes = new ColoringAttributes();
            _appearance.setColoringAttributes(_coloringAttributes);
        }

        // Deal with wireFrame attribute.
        int mode = PolygonAttributes.POLYGON_FILL;
View Full Code Here

     *
     * @param appearance the appearance
     * @param color the color
     */
    public static void setColorWithColoringAttributes(Appearance appearance, Color3f color) {
        ColoringAttributes coloringAttributes = new ColoringAttributes();
        coloringAttributes.setColor(color);
        appearance.setColoringAttributes(coloringAttributes);
    }
View Full Code Here

  ColoringAttributes farb;

  public Achse(final int aling) {
    super();
    this.appear = new Appearance();
    this.farb = new ColoringAttributes(0.4f, 0.4f, 0.4f,
        ColoringAttributes.NICEST);
    this.appear.setColoringAttributes(this.farb);
    // Material mat = new Material();
    // appear.setMaterial(mat);
View Full Code Here

    polyAttr.setPolygonMode(PolygonAttributes.POLYGON_FILL);
    appear.setPolygonAttributes(polyAttr);

    final Color3f orange = new Color3f(1f, 0.5f, 0f);

    final ColoringAttributes colorAttr = new ColoringAttributes();
    colorAttr.setColor(orange);
    colorAttr.setShadeModel(ColoringAttributes.NICEST);
    appear.setColoringAttributes(colorAttr);

    final Material material = new Material();
    material.setAmbientColor(orange);
    material.setDiffuseColor(orange);
    material.setSpecularColor(orange);
    material.setEmissiveColor(orange);
    appear.setMaterial(material);

    final Box box = new Box();
    box.setAppearance(appear);

    final Appearance appear2 = new Appearance();

    final PointAttributes pointAttr2 = new PointAttributes();
    pointAttr2.setPointAntialiasingEnable(true);
    appear2.setPointAttributes(pointAttr2);

    final LineAttributes lineAttr2 = new LineAttributes();
    lineAttr2.setLineAntialiasingEnable(true);
    appear2.setLineAttributes(lineAttr2);

    final PolygonAttributes polyAttr2 = new PolygonAttributes();
    polyAttr2.setPolygonMode(PolygonAttributes.POLYGON_LINE);
    appear2.setPolygonAttributes(polyAttr2);

    final ColoringAttributes colorAttr2 = new ColoringAttributes();
    colorAttr2.setColor(new Color3f(1f, 0.5f, 0f));
    colorAttr2.setShadeModel(ColoringAttributes.NICEST);
    appear2.setColoringAttributes(colorAttr2);

    appear2.setMaterial(material);

    final Box box2 = new Box();
View Full Code Here

/* 150 */       if (shape.facetSizes[0] == 1)
/*     */       {
/* 153 */         GeometryArray object = new PointArray(vertexCount, vertexFormat);
/*     */
/* 155 */         object.setCoordinates(0, shape.coordsArray);
/* 156 */         ColoringAttributes colorAtt = new ColoringAttributes(surf.getColor(), 0);
/*     */
/* 159 */         PointAttributes pointStyle = new PointAttributes();
/* 160 */         pointStyle.setPointSize(1.0F);
/*     */
/* 162 */         appearance.setColoringAttributes(colorAtt);
/* 163 */         appearance.setPointAttributes(pointStyle);
/*     */       }
/* 165 */       else if (shape.facetSizes[0] == 2)
/*     */       {
/* 168 */         debugOutputLn(8, "Creating IndexedLineArray");
/* 169 */         GeometryArray object = new LineArray(vertexCount, vertexFormat);
/*     */
/* 171 */         object.setCoordinates(0, shape.coordsArray);
/* 172 */         ColoringAttributes colorAtt = new ColoringAttributes(surf.getColor(), 0);
/*     */
/* 175 */         appearance.setColoringAttributes(colorAtt);
/*     */       }
/*     */       else
/*     */       {
View Full Code Here

/* 54 */     super(symbol, control);
/*    */   }
/*    */
/*    */   public void writeObject(DataOutput out) throws IOException {
/* 58 */     super.writeObject(out);
/* 59 */     ColoringAttributes attr = (ColoringAttributes)this.node;
/* 60 */     Color3f clr = new Color3f();
/* 61 */     attr.getColor(clr);
/* 62 */     this.control.writeColor3f(out, clr);
/* 63 */     out.writeInt(attr.getShadeModel());
/*    */   }
View Full Code Here

/* 63 */     out.writeInt(attr.getShadeModel());
/*    */   }
/*    */
/*    */   public void readObject(DataInput in) throws IOException {
/* 67 */     super.readObject(in);
/* 68 */     ColoringAttributes attr = (ColoringAttributes)this.node;
/* 69 */     attr.setColor(this.control.readColor3f(in));
/* 70 */     attr.setShadeModel(in.readInt());
/*    */   }
View Full Code Here

/* 69 */     attr.setColor(this.control.readColor3f(in));
/* 70 */     attr.setShadeModel(in.readInt());
/*    */   }
/*    */
/*    */   protected SceneGraphObject createNode() {
/* 74 */     return new ColoringAttributes();
/*    */   }
View Full Code Here

TOP

Related Classes of javax.media.j3d.ColoringAttributes

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.