Examples of ColoringAttributes


Examples of javax.media.j3d.ColoringAttributes

            if (objMaterial.isSharpnessSet()) {
              writer.write("sharpness " + format(objMaterial.getSharpness()) + "\n");
            }
          }
        } else {
          ColoringAttributes coloringAttributes = appearance.getColoringAttributes();
          if (coloringAttributes != null) {
            writer.write("illum 0\n");
            Color3f color = new Color3f();
            coloringAttributes.getColor(color);         
            writer.write("Ka " + format(color.x) + " " + format(color.y) + " " + format(color.z) + "\n");
            writer.write("Kd " + format(color.x) + " " + format(color.y) + " " + format(color.z) + "\n");
            writer.write("Ks " + format(color.x) + " " + format(color.y) + " " + format(color.z) + "\n");
          }
        }
View Full Code Here

Examples of javax.media.j3d.ColoringAttributes

    @Override
    public boolean equals(Object obj) {
      if (obj instanceof ComparableAppearance) {
        Appearance appearance2 = ((ComparableAppearance)obj).appearance;
        // Compare coloring attributes
        ColoringAttributes coloringAttributes1 = this.appearance.getColoringAttributes();
        ColoringAttributes coloringAttributes2 = appearance2.getColoringAttributes();
        if ((coloringAttributes1 == null) ^ (coloringAttributes2 == null)) {
          return false;
        } else if (coloringAttributes1 != coloringAttributes2) {
          Color3f color1 = new Color3f();
          Color3f color2 = new Color3f();
          coloringAttributes1.getColor(color1);
          coloringAttributes2.getColor(color2);
          if (!color1.equals(color2)) {
            return false;
          }
        }
        // Compare material colors
View Full Code Here

Examples of javax.media.j3d.ColoringAttributes

    }
   
    @Override
    public int hashCode() {
      int code = 0;
      ColoringAttributes coloringAttributes = appearance.getColoringAttributes();
      if (coloringAttributes != null) {
        Color3f color = new Color3f();
        coloringAttributes.getColor(color);
        code += color.hashCode();
      }
      Material material = this.appearance.getMaterial();
      if (material != null) {
        Color3f color = new Color3f();
View Full Code Here

Examples of javax.media.j3d.ColoringAttributes

        highlight.setCapability(Material.ALLOW_COMPONENT_WRITE);
        highlightEffect.setSchedulingBounds(BoardModel.bounds);
        addChild(highlightEffect);
        BranchGroup back = new BranchGroup();
        Appearance sapp = new Appearance();
        sapp.setColoringAttributes(new ColoringAttributes(SKY, ColoringAttributes.SHADE_FLAT));
        sapp.setPolygonAttributes(C.noCull);
        sapp.setTexture(tileManager.getTexture("data/images/misc/clouds.jpg"));
        TransformGroup tg = new TransformGroup(new Transform3D(C.mkquat(1, 0, 0, Math.PI/2), new Vector3d(), 1.0));
        tg.addChild(new Sphere(1f, Primitive.GENERATE_TEXTURE_COORDS, 100, sapp));
        back.addChild(tg);
View Full Code Here

Examples of javax.media.j3d.ColoringAttributes

        facing.addChild(mech);

        if (entity.getECMRange() != Entity.NONE) {
            int range = entity.getECMRange();
            Appearance eapp = new Appearance();
            eapp.setColoringAttributes(new ColoringAttributes(c50, ColoringAttributes.SHADE_FLAT));
            TransparencyAttributes ta = new TransparencyAttributes(TransparencyAttributes.BLENDED, 0.90f);
            ta.setCapability(TransparencyAttributes.ALLOW_VALUE_WRITE);
            eapp.setTransparencyAttributes(ta);
            TransparencyInterpolator ti = new TransparencyInterpolator(C.halfAlpha, ta, .90f, .97f);
            ti.setSchedulingBounds(BoardModel.bounds);
            addChild(ti);
            eapp.setPolygonAttributes(C.noCull);
            Shape3D ecm = makeECMArea(range);
            ecm.setAppearance(eapp);
            ecm.setPickable(false);
            facing.addChild(ecm);
            ecm = makeECMBorder(range);
            ecm.setAppearance(eapp);
            ecm.setPickable(false);
            facing.addChild(ecm);
            eapp = new Appearance();
            eapp.setColoringAttributes(new ColoringAttributes(c50, ColoringAttributes.SHADE_FLAT));
            eapp.setLineAttributes(C.defLine);
            ecm = makeECMOutline(range);
            ecm.setAppearance(eapp);
            ecm.setPickable(false);
            facing.addChild(ecm);
View Full Code Here

Examples of javax.media.j3d.ColoringAttributes

            break;
        }
        Color3f color = new Color3f(col);
        Appearance base = new Appearance();
        base.setMaterial(new Material(color, C.black, color, C.white, 64.0f));
        base.setColoringAttributes(new ColoringAttributes(color, ColoringAttributes.SHADE_FLAT));
        base.setPolygonAttributes(C.noCull);
        base.setLineAttributes(C.defLine);
       
        Shape3D arrow = new Shape3D(polygon, base);
        Shape3D outline = new Shape3D(border, base);
View Full Code Here

Examples of javax.media.j3d.ColoringAttributes

        DistanceLOD lod = new DistanceLOD(new float[] { font.getFont().getSize()*10*(float)BoardModel.HEX_DIAMETER });
        lod.addSwitch(sw);
        lod.setSchedulingBounds(BoardModel.bounds);

        Appearance app = new Appearance();
        app.setColoringAttributes(new ColoringAttributes(fg, ColoringAttributes.SHADE_FLAT));
        sw.addChild(new Shape3D(geom, app));

        app = new Appearance();
        Color3f lodfg = new Color3f(fg);
        lodfg.scale(2/3f);
        lodfg.add(C.grey10);
        app.setColoringAttributes(new ColoringAttributes(lodfg, ColoringAttributes.SHADE_FLAT));
        sw.addChild(makeQuad(lower.x, lower.y+(upper.y-lower.y)/4, upper.x-lower.x, (upper.y-lower.y)/2, 0, app));

        addChild(sw);
        addChild(lod);

        setTransform(new Transform3D(C.nullRot, new Vector3d(0,0,0.1), 1.0));

        if (bg != null) {
            app = new Appearance();
            app.setColoringAttributes(new ColoringAttributes(bg, ColoringAttributes.SHADE_FLAT));
            app.setPolygonAttributes(new PolygonAttributes(PolygonAttributes.POLYGON_FILL, PolygonAttributes.CULL_BACK, 10.0f));
            addChild(makeQuad(lower.x-0.5, lower.y-0.1, upper.x-lower.x+1, upper.y-lower.y+.6, -.1, app));
        }
    }
View Full Code Here

Examples of javax.media.j3d.ColoringAttributes

        color = new Color3f(PlayerColors.getColor(ae.getOwner().getColorIndex()));
        color.scale(.5f);

        Appearance base = new Appearance();
        base.setMaterial(new Material(color, C.black, color, C.white, 64.0f));
        base.setColoringAttributes(new ColoringAttributes(color, ColoringAttributes.SHADE_FLAT));
        base.setPolygonAttributes(C.noCull);
        base.setLineAttributes(C.defLine);

        Shape3D arrow = new Shape3D(makeArrow(source.distance(target)), base);
        Shape3D outline = new Shape3D(makeArrowOutline(source.distance(target)), base);
View Full Code Here

Examples of javax.media.j3d.ColoringAttributes

    public CursorModel(Color3f color) {
    setTransform(new Transform3D(C.nullRot, new Vector3d(), 1.0));
        setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);

        Appearance base = new Appearance();
        base.setColoringAttributes(new ColoringAttributes(color, ColoringAttributes.SHADE_FLAT));
        base.setCapability(Appearance.ALLOW_COLORING_ATTRIBUTES_WRITE);
        base.setLineAttributes(C.defLine);
       
        Shape3D shape = new Shape3D(border, base);
        shape.setAppearance(base);
View Full Code Here

Examples of javax.media.j3d.ColoringAttributes

        shape.setAppearance(base);
    addChild(shape);
    }   

    public void setColor(Color3f color) {
        ((Shape3D)getChild(0)).getAppearance().setColoringAttributes(new ColoringAttributes(color, ColoringAttributes.SHADE_FLAT));
    }
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.