Package com.ardor3d.renderer.state

Examples of com.ardor3d.renderer.state.TextureState


        quad.setTranslation(new Vector3(10, 0, 0));
        quad.setModelBound(new BoundingBox());
        quad.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        _root.attachChild(quad);

        final TextureState ts = new TextureState();
        ts.setEnabled(true);
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear,
                TextureStoreFormat.GuessCompressedFormat, true));

        _root.setRenderState(ts);
    }
View Full Code Here


        blend.setBlendEnabled(true);
        blend.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        blend.setDestinationFunction(BlendState.DestinationFunction.One);
        particles.setRenderState(blend);

        final TextureState ts = new TextureState();
        ts.setTexture(TextureManager.load("images/flaresmall.jpg", Texture.MinificationFilter.Trilinear,
                TextureStoreFormat.GuessCompressedFormat, true));
        ts.setEnabled(true);
        particles.setRenderState(ts);

        final ZBufferState zstate = new ZBufferState();
        zstate.setWritable(false);
        particles.setRenderState(zstate);
View Full Code Here

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

        final TextureState ts = new TextureState();
        ts.setEnabled(true);
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear, true));
        _root.setRenderState(ts);

        final MaterialState ms = new MaterialState();
        ms.setColorMaterial(ColorMaterial.Diffuse);
        _root.setRenderState(ms);
View Full Code Here

    private Node createObjects() {
        final Node objects = new Node("objects");

        final Torus torus = new Torus("Torus", 50, 50, 8, 17);
        torus.setTranslation(new Vector3(50, -5, 20));
        TextureState ts = new TextureState();
        torus.addController(new SpatialController<Torus>() {
            private double timer = 0;
            private final Matrix3 rotation = new Matrix3();

            public void update(final double time, final Torus caller) {
                timer += time * 0.5;
                caller.setTranslation(Math.sin(timer) * 40.0, Math.sin(timer) * 40.0, Math.cos(timer) * 40.0);
                rotation.fromAngles(timer * 0.5, timer * 0.5, timer * 0.5);
                caller.setRotation(rotation);
            }
        });

        Texture t0 = TextureManager.load("images/ardor3d_white_256.jpg",
                Texture.MinificationFilter.BilinearNearestMipMap, true);
        ts.setTexture(t0, 0);
        ts.setEnabled(true);
        torus.setRenderState(ts);
        objects.attachChild(torus);

        ts = new TextureState();
        t0 = TextureManager
                .load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.BilinearNearestMipMap, true);
        t0.setWrap(Texture.WrapMode.Repeat);
        ts.setTexture(t0);

        Box box = new Box("box1", new Vector3(-10, -10, -10), new Vector3(10, 10, 10));
        box.setTranslation(new Vector3(0, -7, 0));
        box.setRenderState(ts);
        objects.attachChild(box);

        box = new Box("box2", new Vector3(-5, -5, -5), new Vector3(5, 5, 5));
        box.setTranslation(new Vector3(15, 10, 0));
        box.setRenderState(ts);
        objects.attachChild(box);

        box = new Box("box3", new Vector3(-5, -5, -5), new Vector3(5, 5, 5));
        box.setTranslation(new Vector3(0, -10, 15));
        box.setRenderState(ts);
        objects.attachChild(box);

        box = new Box("box4", new Vector3(-5, -5, -5), new Vector3(5, 5, 5));
        box.setTranslation(new Vector3(20, 0, 0));
        box.setRenderState(ts);
        objects.attachChild(box);

        ts = new TextureState();
        t0 = TextureManager
                .load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.BilinearNearestMipMap, true);
        t0.setWrap(Texture.WrapMode.Repeat);
        ts.setTexture(t0);

        box = new Box("box5", new Vector3(-50, -2, -50), new Vector3(50, 2, 50));
        box.setTranslation(new Vector3(0, -15, 0));
        box.setRenderState(ts);
        box.setModelBound(new BoundingBox());
View Full Code Here

        Quad debugQuad = new Quad("reflectionQuad", quadSize, quadSize);
        debugQuad.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
        debugQuad.getSceneHints().setCullHint(CullHint.Never);
        debugQuad.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        TextureState ts = new TextureState();
        ts.setTexture(waterNode.getTextureReflect());
        debugQuad.setRenderState(ts);
        debugQuad.setTranslation(quadSize * 0.6, quadSize * 1.0, 1.0);
        debugQuadsNode.attachChild(debugQuad);

        if (waterNode.getTextureRefract() != null) {
            debugQuad = new Quad("refractionQuad", quadSize, quadSize);
            debugQuad.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
            debugQuad.getSceneHints().setCullHint(CullHint.Never);
            debugQuad.getSceneHints().setLightCombineMode(LightCombineMode.Off);
            ts = new TextureState();
            ts.setTexture(waterNode.getTextureRefract());
            debugQuad.setRenderState(ts);
            debugQuad.setTranslation(quadSize * 0.6, quadSize * 2.1, 1.0);
            debugQuadsNode.attachChild(debugQuad);
        }
    }
View Full Code Here

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

        // Add a texture to the box.
        final TextureState ts = new TextureState();
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear, true));
        box.setRenderState(ts);

        final PointLight light = new PointLight();

        final Random random = new Random();
View Full Code Here

        as1.setBlendEnabled(true);
        as1.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        as1.setDestinationFunction(BlendState.DestinationFunction.One);
        particles.setRenderState(as1);

        final TextureState ts = new TextureState();
        ts.setTexture(TextureManager.load("images/flaresmall.jpg", Texture.MinificationFilter.Trilinear,
                TextureStoreFormat.GuessCompressedFormat, true));
        ts.setEnabled(true);
        particles.setRenderState(ts);

        final ZBufferState zstate = new ZBufferState();
        zstate.setWritable(false);
        particles.setRenderState(zstate);
View Full Code Here

        t.setTranslation(new Vector3(0, 0, -15));
        _root.attachChild(t);

        t.setRandomColors();

        final TextureState ts = new TextureState();
        ts.setEnabled(true);
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear, true));

        final MaterialState ms = new MaterialState();
        ms.setColorMaterial(ColorMaterial.Diffuse);
        _root.setRenderState(ms);
View Full Code Here

        } catch (final URISyntaxException ex) {
            ex.printStackTrace();
        }

        // Create a texture for our balls to use.
        final TextureState ts = new TextureState();
        ts.setEnabled(true);
        ts.setTexture(TextureManager.load("images/ball.png", Texture.MinificationFilter.NearestNeighborNoMipMaps,
                TextureStoreFormat.GuessCompressedFormat, true));
        root.setRenderState(ts);

        // Add blending.
        final BlendState blend = new BlendState();
View Full Code Here

                boxes.add(sm);
            }
        }

        final TextureState ts = new TextureState();
        ts.setEnabled(true);
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear, true));

        final MaterialState ms = new MaterialState();
        ms.setColorMaterial(ColorMaterial.Diffuse);
        _root.setRenderState(ms);
View Full Code Here

TOP

Related Classes of com.ardor3d.renderer.state.TextureState

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.