Package com.ardor3d.math

Examples of com.ardor3d.math.ColorRGBA


        final Function3D secondaryJade = Functions.scaleBias(perturbedBaseSecondaryJade, .25, 0);
        final Function3D combinedJade = Functions.add(primaryJade, secondaryJade);
        final Function3D finalJade = new TurbulenceFunction3D(combinedJade, 1 / 16.0, 2, 4.0);

        final ReadOnlyColorRGBA[] jadeColors = new ReadOnlyColorRGBA[256];
        jadeColors[0] = new ColorRGBA(24 / 255f, 146 / 255f, 102 / 255f, 1);
        jadeColors[127] = new ColorRGBA(78 / 255f, 154 / 255f, 115 / 255f, 1);
        jadeColors[159] = new ColorRGBA(128 / 255f, 204 / 255f, 165 / 255f, 1);
        jadeColors[175] = new ColorRGBA(78 / 255f, 154 / 255f, 115 / 255f, 1);
        jadeColors[255] = new ColorRGBA(29 / 255f, 135 / 255f, 102 / 255f, 1);
        GeneratedImageFactory.fillInColorTable(jadeColors);

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


        slimeMapper.addFunction(smallSlime, .125, 1, 1);
        slimeMapper.addFunction(largeSlime, 1.75, 0, 0);
        final Function3D finalSlime = new TurbulenceFunction3D(slimeMapper, 1 / 32.0, 2, 8.0);

        final ReadOnlyColorRGBA[] slimeColors = new ReadOnlyColorRGBA[256];
        slimeColors[0] = new ColorRGBA(160 / 255f, 64 / 255f, 42 / 255f, 1);
        slimeColors[127] = new ColorRGBA(64 / 255f, 192 / 255f, 64 / 255f, 1);
        slimeColors[255] = new ColorRGBA(128 / 255f, 255 / 255f, 128 / 255f, 1);
        GeneratedImageFactory.fillInColorTable(slimeColors);

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

        final LightState ls = new LightState();
        ls.setEnabled(true);
        final DirectionalLight dLight = new DirectionalLight();
        dLight.setEnabled(true);
        dLight.setDiffuse(new ColorRGBA(1, 1, 1, 1));
        dLight.setDirection(new Vector3(1, 1, 1));
        ls.attach(dLight);
        final DirectionalLight dLight2 = new DirectionalLight();
        dLight2.setEnabled(true);
        dLight2.setDiffuse(new ColorRGBA(1, 1, 1, 1));
        dLight2.setDirection(new Vector3(-1, -1, -1));
        ls.attach(dLight2);
        ls.setTwoSidedLighting(false);
        transps.setRenderState(ls);
        transps.getSceneHints().setLightCombineMode(LightCombineMode.Replace);

        final Box tb1 = new Box("TBox Blue", min, max);
        tb1.setModelBound(new BoundingBox());
        tb1.setTranslation(new Vector3(0, 15, 15));
        transps.attachChild(tb1);
        final MaterialState ms1 = new MaterialState();
        ms1.setEnabled(true);
        ms1.setDiffuse(MaterialFace.FrontAndBack, new ColorRGBA(0, 0, 1, .75f));
        ms1.setShininess(MaterialFace.FrontAndBack, 128);
        tb1.setRenderState(ms1);

        final Torus tb2 = new Torus("TBox Green", 20, 20, 3, 6);
        tb2.setModelBound(new BoundingBox());
        tb2.setTranslation(new Vector3(0, 0, 30));
        transps.attachChild(tb2);
        final MaterialState ms2 = new MaterialState();
        ms2.setEnabled(true);
        ms2.setDiffuse(MaterialFace.FrontAndBack, new ColorRGBA(0, 1, 0, .5f));
        ms2.setShininess(MaterialFace.FrontAndBack, 128);
        tb2.setRenderState(ms2);

        final Box tb3 = new Box("TBox Red", min, max);
        tb3.setModelBound(new BoundingBox());
        tb3.setTranslation(new Vector3(0, 0, 15));
        transps.attachChild(tb3);
        final MaterialState ms3 = new MaterialState();
        ms3.setEnabled(true);
        ms3.setDiffuse(MaterialFace.FrontAndBack, new ColorRGBA(1, 0, 0, .5f));
        ms3.setShininess(MaterialFace.FrontAndBack, 128);
        tb3.setRenderState(ms3);

        final BlendState as = new BlendState();
        as.setEnabled(true);
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

        _wireframeShaderState = new GLSLShaderObjectsState();
        _wireframeShaderState.setVertexShader(s_vert_passthru_120);
        _wireframeShaderState.setGeometryShader(s_geom_wireframe_150);
        _wireframeShaderState.setFragmentShader(s_frag_wireframe_120);
        _wireframeShaderState.setUniform("wireColor", new ColorRGBA(0, 0, 0, 1));
        _wireframeShaderState.setUniform("faceColor", new ColorRGBA(1, 1, 1, 1));
        _wireframeShaderState.setUniform("factor", 2f);
        _wireframeShaderState.setUniform("scale", scale);
    }
View Full Code Here

    private void setupDefaultStates() {
        _lightState.detachAll();
        final DirectionalLight dLight = new DirectionalLight();
        dLight.setEnabled(true);
        dLight.setAmbient(new ColorRGBA(0.4f, 0.4f, 0.5f, 1));
        dLight.setDiffuse(new ColorRGBA(0.6f, 0.6f, 0.5f, 1));
        dLight.setSpecular(new ColorRGBA(0.3f, 0.3f, 0.2f, 1));
        dLight.setDirection(new Vector3(-1, -1, -1).normalizeLocal());
        _lightState.attach(dLight);
        _lightState.setEnabled(true);

        final CullState cs = new CullState();
View Full Code Here

        manager = new InteractManager();
        manager.setupInput(_canvas, _physicalLayer, _logicalLayer);

        // final add our widget
        final CompoundInteractWidget widget = new CompoundInteractWidget()
                .withMoveXAxis(new ColorRGBA(1, 0, 0, .65f), 1.2, .15, .5, .2)
                .withMoveZAxis(new ColorRGBA(0, 0, 1, .65f), 1.2, .15, .5, .2) //
                .withRotateYAxis() //
                .withPlanarHandle(MovePlane.XZ, new ColorRGBA(1, 0, 1, .65f)) //
                .withRingTexture((Texture2D) TextureManager.load("images/tick.png", MinificationFilter.Trilinear, true));
        // widget.getHandle().setRenderState(_lightState);
        manager.addWidget(widget);
        manager.setActiveWidget(widget);
View Full Code Here

        particles.setInitialVelocity(.006);
        particles.setStartSize(2.5);
        particles.setEndSize(.5);
        particles.setMinimumLifeTime(100);
        particles.setMaximumLifeTime(1500);
        particles.setStartColor(new ColorRGBA(1, 0, 0, 1));
        particles.setEndColor(new ColorRGBA(0, 1, 0, 0));
        particles.setMaximumAngle(360 * MathUtils.DEG_TO_RAD);
        particles.getParticleController().setControlFlow(false);
        particles.setParticlesInWorldCoords(true);

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

        terrainNode.setRenderState(new ZBufferState());

        _lightState.detachAll();
        light = new DirectionalLight();
        light.setEnabled(true);
        light.setAmbient(new ColorRGBA(0.4f, 0.4f, 0.5f, 1));
        light.setDiffuse(new ColorRGBA(0.6f, 0.6f, 0.5f, 1));
        light.setSpecular(new ColorRGBA(0.3f, 0.3f, 0.2f, 1));
        light.setDirection(new Vector3(-1, -1, -1).normalizeLocal());
        _lightState.attach(light);
        _lightState.setEnabled(true);

        final FogState fs = new FogState();
        fs.setStart(farPlane / 2.0f);
        fs.setEnd(farPlane);
        fs.setColor(new ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f));
        fs.setDensityFunction(DensityFunction.Linear);
        terrainNode.setRenderState(fs);
    }
View Full Code Here

    private void setupDefaultStates() {
        _lightState.detachAll();
        final DirectionalLight dLight = new DirectionalLight();
        dLight.setEnabled(true);
        dLight.setAmbient(new ColorRGBA(0.4f, 0.4f, 0.5f, 1));
        dLight.setDiffuse(new ColorRGBA(0.6f, 0.6f, 0.5f, 1));
        dLight.setSpecular(new ColorRGBA(0.3f, 0.3f, 0.2f, 1));
        dLight.setDirection(new Vector3(-1, -1, -1).normalizeLocal());
        _lightState.attach(dLight);
        _lightState.setEnabled(true);

        final CullState cs = new CullState();
        cs.setEnabled(true);
        cs.setCullFace(CullState.Face.Back);
        _root.setRenderState(cs);

        final FogState fs = new FogState();
        fs.setStart(farPlane / 2.0f);
        fs.setEnd(farPlane);
        fs.setColor(new ColorRGBA(1.0f, 1.0f, 1.0f, 1.0f));
        fs.setDensityFunction(DensityFunction.Linear);
        _root.setRenderState(fs);
    }
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.