Package com.ardor3d.scenegraph.shape

Examples of com.ardor3d.scenegraph.shape.Quad


        _canvas.setTitle("Ardor3D: ClipState Example");

        _canvas.getCanvasRenderer().getCamera().setLocation(20, 40, 80);
        _canvas.getCanvasRenderer().getCamera().lookAt(0, 0, 0, Vector3.UNIT_Y);

        final Quad floor = new Quad("floor", 100, 100);
        floor.setRotation(new Matrix3().fromAngleNormalAxis(MathUtils.HALF_PI, Vector3.UNIT_X));
        _root.attachChild(floor);

        final Teapot teapot = new Teapot("teapot");
        teapot.setScale(5);
        _root.attachChild(teapot);
View Full Code Here


        addMesh(new Icosahedron("Icosahedron", 3));
        addMesh(new MultiFaceBox("MultiFaceBox", new Vector3(), 3, 3, 3));
        addMesh(new Octahedron("Octahedron", 3));
        addMesh(new PQTorus("PQTorus", 5, 4, 1.5, .5, 128, 8));
        addMesh(new Pyramid("Pyramid", 2, 4));
        addMesh(new Quad("Quad", 3, 3));
        addMesh(new RoundedBox("RoundedBox", new Vector3(3, 3, 3)));
        addMesh(new Sphere("Sphere", 16, 16, 3));
        addMesh(new GeoSphere("GeoSphere", true, 3, 3, TextureMode.Original));
        addMesh(new StripBox("StripBox", new Vector3(), 3, 3, 3));
        addMesh(new Teapot("Teapot"));
View Full Code Here

        box2.setSolidColor(ColorRGBA.RED);
        box2.setRenderState(ms);
        box2.updateModelBound();

        // A text to check aspect ratio of 2D objects
        quad = new Quad("test quad", 100, 20);
        quad.getSceneHints().setRenderBucketType(RenderBucketType.Ortho);
        quad.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        // if we don't explicitly update model bounds, quad will keep its default infinite bounding sphere, so it will
        // always display (and it will prevent rootnode from culling)
View Full Code Here

        _canvas.getCanvasRenderer().getCamera().setLocation(20, 40, 80);
        _canvas.getCanvasRenderer().getCamera().lookAt(0, 0, 0, Vector3.UNIT_Y);

        projector.setFrustumPerspective(20.0f, 1.0f, 1.0f, 1000.0f);

        final Quad floor = new Quad("floor", 100, 100);
        floor.setRotation(new Matrix3().fromAngleNormalAxis(MathUtils.HALF_PI, Vector3.UNIT_X));
        _root.attachChild(floor);

        final Teapot teapot = new Teapot("teapot");
        teapot.setScale(5);
        _root.attachChild(teapot);
View Full Code Here

        addMesh(new Icosahedron("Icosahedron", 3));
        addMesh(new MultiFaceBox("MultiFaceBox", new Vector3(), 3, 3, 3));
        addMesh(new Octahedron("Octahedron", 3));
        addMesh(new PQTorus("PQTorus", 5, 4, 1.5, .5, 128, 8));
        addMesh(new Pyramid("Pyramid", 2, 4));
        addMesh(new Quad("Quad", 3, 3));
        addMesh(new RoundedBox("RoundedBox", new Vector3(3, 3, 3)));
        addMesh(new Sphere("Sphere", 16, 16, 3));
        addMesh(new GeoSphere("GeoSphere", true, 3, 3, TextureMode.Original));
        addMesh(new StripBox("StripBox", new Vector3(), 3, 3, 3));
        addMesh(new Teapot("Teapot"));
View Full Code Here

        sphere = new Sphere("Sphere", 25, 25, 5);
        sphere.setTranslation(new Vector3(-10, 0, 0));
        sphere.setModelBound(new BoundingBox());
        _root.attachChild(sphere);

        quad = new Quad("Quad", 15, 13f);
        quad.setTranslation(new Vector3(10, 0, 0));
        quad.setModelBound(new BoundingBox());
        quad.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        _root.attachChild(quad);
View Full Code Here

        debugQuadsNode = new Node("quadNode");
        debugQuadsNode.getSceneHints().setCullHint(CullHint.Never);

        final double quadSize = _canvas.getCanvasRenderer().getCamera().getWidth() / 10;

        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

        sphere = new Sphere("Sphere", 25, 25, 5);
        sphere.setTranslation(new Vector3(-10, 0, 0));
        sphere.setModelBound(new BoundingBox());
        _root.attachChild(sphere);

        quad = new Quad("Quad", 15, 13f);
        quad.setTranslation(new Vector3(10, 0, 0));
        quad.setModelBound(new BoundingBox());
        quad.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        _root.attachChild(quad);
View Full Code Here

        transps.setRenderState(as);

        final Vector2 center = new Vector2(_canvas.getCanvasRenderer().getCamera().getWidth() >> 1, _canvas
                .getCanvasRenderer().getCamera().getWidth() >> 1);

        final Quad q1 = new Quad("Ortho Q1", 40, 40);
        q1.setTranslation(new Vector3(100 + center.getX(), 100 + center.getY(), 0));
        q1.getSceneHints().setOrthoOrder(1);
        q1.setDefaultColor(ColorRGBA.WHITE);
        q1.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        orthos.attachChild(q1);

        final Quad q2 = new Quad("Ortho Q2", 100, 100);
        q2.setTranslation(new Vector3(60 + center.getX(), 60 + center.getY(), 0));
        q2.getSceneHints().setOrthoOrder(5);
        q2.setDefaultColor(ColorRGBA.RED);
        q2.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        orthos.attachChild(q2);

        final Quad q3 = new Quad("Ortho Q3", 120, 60);
        q3.setTranslation(new Vector3(-20 + center.getX(), -150 + center.getY(), 0));
        q3.getSceneHints().setOrthoOrder(2);
        q3.setDefaultColor(ColorRGBA.BLUE);
        q3.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        orthos.attachChild(q3);

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

        _lightState.setTwoSidedLighting(true);
    }

    private Mesh createFloor() {
        final Mesh floor = new Quad("Floor", 100, 100);
        floor.updateModelBound();
        // set the color to green using a single color value
        floor.setDefaultColor(ColorRGBA.GREEN);
        // move back from camera.
        floor.setTranslation(0, -5, -20);
        // rotate to point up
        floor.setRotation(new Quaternion(-1, 0, 0, 1));

        // Add a material state.
        final MaterialState ms = new MaterialState();
        floor.setRenderState(ms);
        // Pull diffuse color for front and back from mesh color
        ms.setColorMaterial(ColorMaterial.Diffuse);
        ms.setColorMaterialFace(MaterialFace.FrontAndBack);

        return floor;
View Full Code Here

TOP

Related Classes of com.ardor3d.scenegraph.shape.Quad

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.