Package libshapedraw.transform

Examples of libshapedraw.transform.ShapeRotate


        // Even though the Shape is custom-built it works like any other Shape.
        // We can add transforms, animations, etc.
        myShape.getColor().animateStartLoop(Color.CRIMSON, true, 5000);
        myShape.addTransform(
                new ShapeRotate(0.0, Axis.Y)
                .animateStartLoop(360.0, false, 30000));
    }
View Full Code Here


                Color.HOT_PINK.copy().scaleAlpha(XrayShape.SECONDARY_ALPHA),
                2.5F, Float.MIN_NORMAL, 5.0F);
        shape.setSlices(12).setStacks(8).setWireframe(true, 3.0F);
        Vector3 vector = new Vector3();
        shape.addTransform(new ShapeTranslate(vector));
        shape.addTransform(new ShapeRotate(90.0, Axis.X)); // upright
        libShapeDraw.addShape(shape);

        // Animate it with a custom Timeline, using a Sine ease. This makes
        // the animation start out fast, then slow down at the end of each
        // cycle.
View Full Code Here

        GLUSphere sphere = new GLUSphere(new Vector3(8, 63, 0),
                Color.DODGER_BLUE.copy(),
                Color.DODGER_BLUE.copy().setAlpha(0.25),
                1.0F);
        sphere.setSlices(8).setStacks(8).setWireframe(true, 3.0F);
        ShapeRotate rotate = new ShapeRotate(0.0, Axis.Y);
        sphere.addTransform(rotate);
        libShapeDraw.addShape(sphere);
        rotate.animateStartLoop(360.0, false, 5000);
    }
View Full Code Here

        // always right in front of the player.
        WireframeCuboid shape = new WireframeCuboid(
                playerCoords.copy().add(2.75, -1.0, -0.25),
                playerCoords.copy().add(3.250.00.25));
        shape.setLineStyle(new Color(Math.random(), Math.random(), Math.random(), 0.8), 3.0F, true);
        ShapeRotate rotate = new ShapeRotate(0.0, 0.1, 0.8, 0.2); // wonky axis
        shape.addTransform(rotate);
        libShapeDraw.addShape(shape);

        // Start the looping animation and keep a reference to the ShapeRotate
        // so we can stop it later.
        //
        // Each spawned Shape get its own ShapeRotate transform with its own
        // animation rate.
        //
        // If you're animating a large number of Shapes, or if you want
        // animations to be in sync with each other, you can simply re-use a
        // single ShapeRotate for multiple Shapes. This shared instance
        // technique can also be used for Colors and other animateable objects.
        shapeRotations.add(rotate);
        rotate.animateStartLoop(360.0, false, (long) (3000 + Math.random()*10000));
    }
View Full Code Here

        .addEventListener(this)
        .setVisible(false)
        .setVisibleWhenHidingGui(true);

        lineStyle = new LineStyle(Color.WHITE.copy(), 5.0F, true);
        shapeRotate = new ShapeRotate(0, 0, 1, 0);

        origin = Vector3.ZEROS.copy();
        for (int[] pairs : LINE_DATA) {
            ArrayList<ReadonlyVector3> vec = new ArrayList<ReadonlyVector3>(pairs.length / 2);
            for (int i = 0; i < pairs.length; i += 2) {
View Full Code Here

        MockMinecraftAccess mc = new MockMinecraftAccess();
        shape.render(mc);
        assertEquals(1, shape.getCountRender());

        shape.addTransform(new ShapeRotate(45.0, 0.0, 1.0, 0.0));
        assertEquals(1, shape.getTransforms().size());
        shape.addTransform(new ShapeScale(1.0, 1.5, 1.0));
        assertEquals(2, shape.getTransforms().size());
        ShapeTranslate transform0 = new ShapeTranslate(0.0, 0.0, 18.25);
        ShapeTranslate transform1 = new ShapeTranslate(0.0, -5.0, 0.0);
View Full Code Here

        assertEquals(prefix+"{V}(15.0,66.0,-200.5)", box.toString());
        box.setVisible(false);
        assertEquals(prefix+"{}(15.0,66.0,-200.5)", box.toString());
        box.getUpperCorner().addY(20.5);
        assertEquals(prefix+"{}(15.0,76.25,-200.5)", box.toString());
        box.addTransform(new ShapeRotate(22.5, Axis.Y));
        assertEquals(prefix+"{T}(15.0,76.25,-200.5)", box.toString());
        box.setVisible(true);
        assertEquals(prefix+"{VT}(15.0,76.25,-200.5)", box.toString());
    }
View Full Code Here

TOP

Related Classes of libshapedraw.transform.ShapeRotate

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.