Package com.ardor3d.math

Examples of com.ardor3d.math.ColorRGBA


    }

    @Override
    protected void initExample() {
        _canvas.setTitle("BMFont Text Example");
        final ColorRGBA backgroundColor = new ColorRGBA(0.3f, 0.3f, 0.5f, 1);
        final CanvasRenderer canvasRenderer = _canvas.getCanvasRenderer();
        final RenderContext renderContext = canvasRenderer.getRenderContext();
        final Renderer renderer = canvasRenderer.getRenderer();
        GameTaskQueueManager.getManager(renderContext).getQueue(GameTaskQueue.RENDER).enqueue(new Callable<Void>() {
            @Override
View Full Code Here


                    } else {
                        text.setAutoRotate(true);
                    }

                    if (rand.nextDouble() < 0.5) {
                        final ColorRGBA clr = new ColorRGBA(rand.nextFloat(), rand.nextFloat(), rand.nextFloat(), 1);
                        text.setTextColor(clr);
                    } else {
                        text.setTextColor(ColorRGBA.WHITE);
                    }
                    text.setFont(fonts.get(index));
View Full Code Here

            t.getSceneHints().setLightCombineMode(LightCombineMode.Off);
            t.setTranslation(new Vector3(0, 20, 0));
            _root.attachChild(t);
        } else {
            textureRenderer.getCamera().setLocation(new Vector3(-10, 0, 15));
            textureRenderer.setBackgroundColor(new ColorRGBA(0f, 0f, 0f, 1));
            fakeTex = new Texture2D();
            textureRenderer.setupTexture(fakeTex);
            final TextureState screen = new TextureState();
            screen.setTexture(fakeTex);
            screen.setEnabled(true);
View Full Code Here

        particles.setMaximumAngle(45 * MathUtils.DEG_TO_RAD);
        particles.getParticleController().setControlFlow(false);
        particles.setParticlesInWorldCoords(true);

        // Start color is RED, opaque
        particles.setStartColor(new ColorRGBA(1, 0, 0, 1));
        particles.setStartSize(2.5);

        // At 25% life, let's have the color be WHITE, opaque
        final RampEntry entry25 = new RampEntry(.25);
        entry25.setColor(new ColorRGBA(1, 1, 1, 1));
        particles.getRamp().addEntry(entry25);

        // At 50% life, (25% higher than previous) let's have the color be RED, opaque and twice as big.
        // Note that at 25% life the size will be about 3.75 since we did not set a size on that.
        final RampEntry entry50 = new RampEntry(.25);
        entry50.setColor(new ColorRGBA(1, 0, 0, 1));
        entry50.setSize(5);
        particles.getRamp().addEntry(entry50);

        // At 75% life, (25% higher than previous) let's have the color be WHITE, opaque
        final RampEntry entry75 = new RampEntry(.25);
        entry75.setColor(new ColorRGBA(1, 1, 1, 1));
        particles.getRamp().addEntry(entry75);

        // End color is BLUE, opaque (size is back to 2.5 now.
        particles.setEndColor(new ColorRGBA(0, 0, 1, 1));
        particles.setEndSize(2.5);

        particles.warmUp(60);

        final BlendState blend = new BlendState();
View Full Code Here

        for (int i = 0; i < 150; i++) {
            final Box box = new Box("b" + i, new Vector3(0, 0, 0), new Vector3(0.1f, 0.1f, 0.1f));
            box.updateModelBound();
            box.setRandomColors();
            final MaterialState ms = new MaterialState();
            ms.setDiffuse(MaterialFace.FrontAndBack, new ColorRGBA(r.nextFloat(), r.nextFloat(), r.nextFloat(), 1));
            box.setRenderState(ms);
            box.setTranslation(new Vector3(r.nextFloat(), r.nextFloat(), r.nextFloat()));
            box.setRotation(new Quaternion(r.nextFloat(), r.nextFloat(), r.nextFloat(), 1));
            node.attachChild(box);
        }
View Full Code Here

     */
    private void setupFog() {
        final FogState fogState = new FogState();
        fogState.setDensity(1.0f);
        fogState.setEnabled(true);
        fogState.setColor(new ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f));
        fogState.setEnd((float) farPlane);
        fogState.setStart((float) farPlane / 10.0f);
        fogState.setDensityFunction(FogState.DensityFunction.Linear);
        fogState.setQuality(FogState.Quality.PerVertex);
        _root.setRenderState(fogState);
View Full Code Here

        final float r = random.nextFloat();
        final float g = random.nextFloat();
        final float b = random.nextFloat();
        final float a = random.nextFloat();

        light.setDiffuse(new ColorRGBA(r, g, b, a));
        light.setAmbient(new ColorRGBA(0.5f, 0.5f, 0.5f, 1.0f));
        light.setLocation(new Vector3(MOVE_SPEED, MOVE_SPEED, MOVE_SPEED));
        light.setEnabled(true);

        /** Attach the light to a lightState and the lightState to rootNode. */
        final LightState lightState = new LightState();
View Full Code Here

        particles.setEndSize(1.5);
        particles.setOriginOffset(new Vector3(0, 0, 0));
        particles.setInitialVelocity(.05);
        particles.setMinimumLifeTime(5000);
        particles.setMaximumLifeTime(15000);
        particles.setStartColor(new ColorRGBA(1, 0, 0, 1));
        particles.setEndColor(new ColorRGBA(0, 1, 0, 1));
        particles.setMaximumAngle(360f * MathUtils.DEG_TO_RAD);
        particles.getParticleController().setControlFlow(false);
        particles.getParticleController().setSpeed(0.75);
        swarm = new SwarmInfluence(new Vector3(particles.getWorldTranslation()), .001);
        swarm.setMaxSpeed(.2);
View Full Code Here

        setVoronoi(srcs[index++]);

        // *** 'Planet' example:
        final Function3D terrain = Functions.scaleInput(Functions.simplexNoise(), 2, 2, 1);
        terrainColors = new ReadOnlyColorRGBA[256];
        terrainColors[0] = new ColorRGBA(0, 0, .5f, 1);
        terrainColors[95] = new ColorRGBA(0, 0, 1, 1);
        terrainColors[127] = new ColorRGBA(0, .5f, 1, 1);
        terrainColors[137] = new ColorRGBA(240 / 255f, 240 / 255f, 64 / 255f, 1);
        terrainColors[143] = new ColorRGBA(32 / 255f, 160 / 255f, 0, 1);
        terrainColors[175] = new ColorRGBA(224 / 255f, 224 / 255f, 0, 1);
        terrainColors[223] = new ColorRGBA(128 / 255f, 128 / 255f, 128 / 255f, 1);
        terrainColors[255] = ColorRGBA.WHITE;
        GeneratedImageFactory.fillInColorTable(terrainColors);

        // simplex - luminance
        setTerrain(srcs[index], terrain, false, false);
View Full Code Here

        final Function3D rotatedWood = Functions.rotateInput(translatedWood, new Matrix3().fromAngles(
                MathUtils.DEG_TO_RAD * 6, 0, 0));
        final Function3D finalWood = new TurbulenceFunction3D(rotatedWood, 1 / 512.0, 2, 2.0);

        final ReadOnlyColorRGBA[] woodColors = new ReadOnlyColorRGBA[256];
        woodColors[0] = new ColorRGBA(189 / 255f, 94 / 255f, 4 / 255f, 1);
        woodColors[127] = new ColorRGBA(144 / 255f, 48 / 255f, 6 / 255f, 1);
        woodColors[255] = new ColorRGBA(60 / 255f, 10 / 255f, 8 / 255f, 1);
        GeneratedImageFactory.fillInColorTable(woodColors);

        Image img = GeneratedImageFactory.createLuminance8Image(finalWood, wside, hside, 1);
        img = GeneratedImageFactory.createColorImageFromLuminance8(img, false, woodColors);
        tex.setImage(img);
View Full Code Here

TOP

Related Classes of com.ardor3d.math.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.