Package com.ardor3d.scenegraph.shape

Examples of com.ardor3d.scenegraph.shape.Torus


     * @return the node containing the objects
     */
    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);
View Full Code Here


        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"));
        addMesh(new Torus("Torus", 16, 8, 1.0, 2.5));
        addMesh(new Tube("Tube", 2, 3, 4));

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

        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"));
        addMesh(new Torus("Torus", 16, 8, 1.0, 2.5));
        addMesh(new Tube("Tube", 2, 3, 4));
        addMesh(createLines());

        final TextureState ts = new TextureState();
        ts.setTexture(TextureManager.load("images/ardor3d_white_256.jpg", Texture.MinificationFilter.Trilinear,
View Full Code Here

     * @return the node containing the objects
     */
    private Node createObjects() {
        final Node objects = new Node("objects");

        final Torus torus = new Torus("Torus", 30, 20, 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);
View Full Code Here

     * @return the node containing the objects
     */
    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);
View Full Code Here

        final Teapot teapot = new Teapot("Teapot");
        teapot.setScale(2.0);
        teapot.setTranslation(new Vector3(3, 0, 0));
        node.attachChild(teapot);

        final Torus torus = new Torus("Torus", 128, 128, 2, 4);
        torus.setTranslation(new Vector3(-8, 3, 0));
        node.attachChild(torus);

        return node;
    }
View Full Code Here

        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);
View Full Code Here

            b.setTranslation(new Vector3(x, y, z));

            occluders.attachChild(b);
        }

        final Torus torusWithoutShadows = new Torus("torus", 32, 10, 15.0f, 20.0f);
        torusWithoutShadows.setModelBound(new BoundingBox());
        torusWithoutShadows.getSceneHints().setCastsShadows(false);
        torusWithoutShadows.setTranslation(0, 50, -100);
        occluders.attachChild(torusWithoutShadows);

        final Torus torus = new Torus("torus", 64, 12, 10.0f, 15.0f);
        torus.setModelBound(new BoundingBox());
        occluders.attachChild(torus);
        torus.addController(new SpatialController<Torus>() {
            double timer = 0;
            Matrix3 rotation = new Matrix3();

            public void update(final double time, final Torus caller) {
                timer += time;
View Full Code Here

        tp.setModelBound(new BoundingBox());
        tp.setTranslation(new Vector3(0, 0, -50));
        tp.setScale(2);
        _root.attachChild(tp);

        final Mesh torus = new Torus("Torus", 16, 16, 1, 4);
        torus.setModelBound(new BoundingBox());
        torus.setTranslation(new Vector3(4, 0, -10));
        _root.attachChild(torus);

        final Mesh sphere = new Sphere("Sphere", 16, 16, 5);
        sphere.setModelBound(new BoundingBox());
        sphere.setTranslation(new Vector3(-8, 0, -30));
View Full Code Here

        t1.setEnvironmentalMapMode(Texture.EnvironmentalMapMode.SphereMap);
        ts.setTexture(t0, 0);
        ts.setTexture(t1, 1);
        ts.setEnabled(true);

        final Torus torus = new Torus("Torus", 50, 50, 10, 25);
        torus.updateModelBound();
        torus.setRenderState(ts);

        final Quad quad = new Quad("Quad");
        quad.resize(150, 120);
        quad.updateModelBound();
        quad.setRenderState(bgts);
View Full Code Here

TOP

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

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.