Examples of ColoringAttributes


Examples of javax.media.j3d.ColoringAttributes

      Transform3D translation;
      translation = new Transform3D();
      translation.setTranslation(new Vector3f (0, 0, 20));
      tg.setTransform(translation);
      Sphere sphere = new Sphere(1.2f);
      sphere.getAppearance().setColoringAttributes(new ColoringAttributes(0.1f, 0.8f, 0.8f, ColoringAttributes.NICEST));
      tg.addChild(sphere);
      parent.addChild(tg);
     
      TransformGroup tg2 = new TransformGroup();
      Transform3D translation2;
View Full Code Here

Examples of javax.media.j3d.ColoringAttributes

            material.setDiffuseColor(new Color3f(0.0f, 0.0f, 1.0f));
            materialAppear.setMaterial(material);
        }
       
       
        ColoringAttributes ca = new ColoringAttributes();
        ca.setColor(0.3f, 0.3f, 0.3f);
        materialAppear.setColoringAttributes(ca);

        return materialAppear;
    }
View Full Code Here

Examples of javax.media.j3d.ColoringAttributes

        Material material = new Material();
        material.setDiffuseColor(new Color3f(0.2f, 0.2f, 0.2f));
        materialAppear.setMaterial(material);
       
        ColoringAttributes ca = new ColoringAttributes();
        ca.setColor(0.5f, 0.5f, 0.5f);
        materialAppear.setColoringAttributes(ca);

        return materialAppear;
    }
View Full Code Here

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

Examples of javax.media.j3d.ColoringAttributes

    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

Examples of javax.media.j3d.ColoringAttributes

        // 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

Examples of javax.media.j3d.ColoringAttributes

     *
     * @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

Examples of javax.media.j3d.ColoringAttributes

  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

Examples of javax.media.j3d.ColoringAttributes

    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

Examples of javax.media.j3d.ColoringAttributes

/* 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
TOP
Copyright © 2018 www.massapi.com. 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.