Package com.jme.renderer

Examples of com.jme.renderer.ColorRGBA


    @Override
    public void setHudElementColor(ColorRGBA color) {
        sb.setHudElementColor(color);
        throttle.setHudElementColor(color);
        brake.setColors(color, new ColorRGBA(1,0,0,color.a));
    }
View Full Code Here


                markerVertices.add(new Vector3f(-i * spacing, 0, -size));
                markerVertices.add(new Vector3f(-i * spacing, 0, size));
            }
        }
        Geometry regularGrid = new Line("regularLine", regularVertices.toArray(new Vector3f[] {}), null, null, null);
        regularGrid.getDefaultColor().set(new ColorRGBA(1, 1, 1, 0.05f));
        regularGrid.setModelBound(new BoundingBox());
        regularGrid.updateModelBound();
        lines.attachChild(regularGrid);
        Geometry markerGrid = new Line("markerLine", markerVertices.toArray(new Vector3f[] {}), null, null, null);
        markerGrid.getDefaultColor().set(new ColorRGBA(1, 1, 1, 0.1f));
        markerGrid.setModelBound(new BoundingBox());
        markerGrid.updateModelBound();
        lines.attachChild(markerGrid);
        if (rotation != null) lines.getLocalRotation().fromAngles(rotation.x, rotation.y, rotation.z);

        Node axis = new Node("axis");
        this.attachChild(axis);
        Vector3f xAxis = new Vector3f(size + (marker * spacing), 0, 0); // red
        Vector3f yAxis = new Vector3f(0, size + (marker * spacing), 0); // green
        Vector3f zAxis = new Vector3f(0, 0, size + (marker * spacing)); // blue
        Vector3f zero = new Vector3f();
        ColorRGBA red = new ColorRGBA(1, 0, 0, 0.8f);
        ColorRGBA green = new ColorRGBA(0, 1, 0, 0.8f);
        ColorRGBA blue = new ColorRGBA(0, 0, 1, 0.8f);
        Line lx = new Line("xAxis", new Vector3f[] { zero, xAxis }, null, new ColorRGBA[] { red, red }, null);
        Line ly = new Line("yAxis", new Vector3f[] { zero, yAxis }, null, new ColorRGBA[] { green, green }, null);
        Line lz = new Line("zAxis", new Vector3f[] { zero, zAxis }, null, new ColorRGBA[] { blue, blue }, null);
        lx.setModelBound(new BoundingBox());
        lx.updateModelBound();
View Full Code Here

        }
    }

    public void setPercentRotation(float rot) {
        setLocalRotation(getLocalRotation().fromAngles(0f, 0f, rot * 0.5f));
        ColorRGBA c = new ColorRGBA();
        ColorRGBA maxColor = new ColorRGBA(1, 0, 0, Hud.defaultHudColor.a);
        c.interpolate(Hud.defaultHudColor, maxColor, FastMath.abs(rot));
        cc.setHudElementColor(c);
    }
View Full Code Here

              buildTerrain();
                          
                
              MaterialState ms = display.getRenderer().createMaterialState();
              ms.setEmissive(new ColorRGBA(1.0f,1.0f,1.0f,0.5f));
              tc.setRenderState(ms);

              tc.setLocalTranslation(0,0,-10000);
              rootNode.attachChild(tc);             
  }              
View Full Code Here

        int i = (int) (this.percent / step);
        if (i == color.length - 1) {
            setSolidColor(color[i]);
        } else {
            float percentColor = (1 / step) * (this.percent - (i * step));
            ColorRGBA c = new ColorRGBA();
            c.interpolate(color[i], color[i + 1], percentColor);
            setSolidColor(c);
        }
    }
View Full Code Here

        getIndexBuffer().put(3);
    }

    @Override
    public void setHudElementColor(ColorRGBA color) {
        ColorRGBA maxColor = new ColorRGBA(0, 1, 0, color.a);
        setColors(color, maxColor);
    }
View Full Code Here

    private static ColorRGBA getColorRGBA(FloatBuffer buf) {
        float r = buf.get();
        float g = buf.get();
        float b = buf.get(2);
        float a = buf.get(3);
        return new ColorRGBA(r, g, b, a);
    }
View Full Code Here

    }

    private LightNode createLight(float x, float y, float z) {
        LightNode lightNode = new LightNode();
        DirectionalLight light = new DirectionalLight();
        light.setDiffuse(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        light.setAmbient(new ColorRGBA(0.1f, 0.1f, 0.1f, 1.0f));
        light.setSpecular(new ColorRGBA(0.4f, 0.4f, 0.4f, 1.0f));
        light.setEnabled(true);
        lightNode.setLight(light);
        lightNode.setLocalTranslation(x, y, z);
        light.setDirection(new Vector3f(-x, -y, -z));
        return (lightNode);
View Full Code Here

  MaterialState ms = (MaterialState) getRenderState(RenderState.RS_MATERIAL);
  if (ms == null) {
      ms = DisplaySystem.getDisplaySystem().getRenderer().createMaterialState();
      setRenderState(ms);
  }
  ms.setAmbient(new ColorRGBA(color));
  ms.setDiffuse(new ColorRGBA(color));
    }
View Full Code Here

     * Returns the ambient-and-diffuse color of this quad.
     */
    public ColorRGBA getColor () {
  MaterialState ms = (MaterialState) getRenderState(RenderState.RS_MATERIAL);
  if (ms == null) {
      return new ColorRGBA(1f, 1f, 1f, 1f);
  } else {
      return ms.getDiffuse();
  }
    }
View Full Code Here

TOP

Related Classes of com.jme.renderer.ColorRGBA

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.