Examples of ColorRGBA


Examples of com.jme.renderer.ColorRGBA

        for (int x = 0; x < size; x++) {
            for (int z = 0; z < size; z++) {
                orand = rand.nextFloat() - .5f;
                for (int i = 0; i < turnNumber; i++) {
                    frand = (rand.nextFloat() * 0.50f) + 0.50f;
                    GeometryBatchInstance instance = new GeometryBatchInstance(q, new GeometryBatchInstanceAttributes(instanceTranslation.set((x * VegetationManager.VEGETATION_STEP) + orand, scale / 2, (z * VegetationManager.VEGETATION_STEP) + orand), new Vector3f(scale * frand, scale * frand, scale * frand), new Quaternion().fromAngleAxis((float) ((Math.PI * 2) / turnNumber) * i, Vector3f.UNIT_Y), new ColorRGBA(INSTANCE_COLOR.r + (rand.nextFloat() / 10f), INSTANCE_COLOR.g + (rand.nextFloat() / 8f), INSTANCE_COLOR.b + (rand.nextFloat() / 8f), INSTANCE_COLOR.a)));

                    creator.addInstance(instance);
                }
            }
        }
View Full Code Here

Examples of com.jme.renderer.ColorRGBA

        buf.setEnabled(true);
        buf.setFunction(ZBufferState.TestFunction.LessThanOrEqualTo);
        rootNode.setRenderState(buf);

        PointLight light = new PointLight();
        light.setDiffuse(new ColorRGBA(0.75f, 0.75f, 1.0f, 0.75f));
        light.setAmbient(new ColorRGBA(0.1f, 0.1f, 0.1f, 1.0f));
        light.setLocation(new Vector3f(40, 40, 40));
        light.setEnabled(true);

        PointLight light2 = new PointLight();
        light2.setDiffuse(new ColorRGBA(1.0f, 0.0f, 0.0f, 0.0f));
        light2.setAmbient(new ColorRGBA(0.0f, 0.0f, 0.0f, 1.0f));
        light2.setLocation(new Vector3f(-140, -140, -140));
        light2.setEnabled(true);
        light2.setShadowCaster(true);
        lightState = display.getRenderer().createLightState();
        lightState.setEnabled(true);
View Full Code Here

Examples of com.jme.renderer.ColorRGBA

        axisRoot=new Node("axnode");
        axisRoot.setLocalTranslation(0, 0, 0);

        MaterialState materialp = display.getRenderer().createMaterialState();
        materialp.setShininess( 128 );
        ColorRGBA color = new ColorRGBA( 0.5f, 0.5f, 0.5f, 0.1f );
        materialp.setDiffuse( color );
        materialp.setAmbient( color.mult( new ColorRGBA( 0.5f, 0.5f, 0.5f, 0.1f ) ) );
        planeXY=new Box("planeXY",new Vector3f(0.05f,0,0.05f),0.1f,0.0001f,0.1f);
        planeXY.setRenderState(materialp);

        MaterialState materialx = display.getRenderer().createMaterialState();
        materialx.setShininess( 128 );
        color = new ColorRGBA( 1f, 0f, 0f, 0.1f );
        materialx.setDiffuse( color );
        materialx.setAmbient( color.mult( new ColorRGBA( 1f, 0.1f, 0.1f, 1 ) ) );



        axisXArrow=new Arrow("ax",0.1f,0.01f);
        axisXArrow.setLocalTranslation(new Vector3f(0.05f,0,0));
        axisXArrow.rotateUpTo(new Vector3f(1,0,0));
        axisXArrow.setRenderState(materialx);

        MaterialState materialy = display.getRenderer().createMaterialState();
        materialy.setShininess( 128 );
        color = new ColorRGBA( 0f, 1f, 0f, 0.5f );
        materialy.setDiffuse( color );
        materialy.setAmbient( color.mult( new ColorRGBA( 0.1f, 1f, 0.1f, 0.5f ) ) );

        axisYArrow=new Arrow("ay",0.1f,0.01f);
        axisYArrow.setLocalTranslation(new Vector3f(0,0.05f,0));
        axisYArrow.rotateUpTo(new Vector3f(0,1,0));
        axisYArrow.setRenderState(materialy);

        MaterialState materialz = display.getRenderer().createMaterialState();
        materialz.setShininess( 128 );
        color = new ColorRGBA( 0f, 0f, 1f, 0.5f );
        materialz.setDiffuse( color );
        materialz.setAmbient( color.mult( new ColorRGBA( 0.1f, 0.1f, 1f, 0.5f ) ) );

        axisZArrow=new Arrow("az",0.1f,0.01f);
        axisZArrow.setLocalTranslation(new Vector3f(0,0,0.05f));
        axisZArrow.rotateUpTo(new Vector3f(0,0,1));
        axisZArrow.setRenderState(materialz);
View Full Code Here

Examples of com.jme.renderer.ColorRGBA

            sharedMesh.setLocalScale(r.nextInt(50) * 0.1f);
            MaterialState ms = renderer.createMaterialState();
            linesPoint.add(sharedMesh.getLocalTranslation());

            if (useTransparency) {
                ms.setDiffuse(new ColorRGBA(r.nextInt(100) * 0.01f, r.nextInt(100) * 0.01f, r.nextInt(100) * 0.01f, (r.nextInt(40) + 60) * 0.01f));
            } else {
                ms.setDiffuse(new ColorRGBA(r.nextInt(100) * 0.01f, r.nextInt(100) * 0.01f, r.nextInt(100) * 0.01f, 1));
            }
            sharedMesh.setRenderState(ms);
            sharedMesh.updateModelBound();
            //sharedMesh.lock();
            subNode[index].attachChild(sharedMesh);
View Full Code Here

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

Examples of com.jme.renderer.ColorRGBA

                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

Examples of com.jme.renderer.ColorRGBA

        }
    }

    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

Examples of com.jme.renderer.ColorRGBA

              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

Examples of com.jme.renderer.ColorRGBA

        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

Examples of com.jme.renderer.ColorRGBA

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