Package libshapedraw.shape

Examples of libshapedraw.shape.WireframeCuboid


    @Override
    public void load() {
        // We could have just as easily set up the API in the constructor
        // instead; LibShapeDraw is designed to be as flexible as possible.
        libShapeDraw = new LibShapeDraw();
        WireframeCuboid box = new WireframeCuboid(0,63,0, 1,64,1);
        box.setLineStyle(Color.CYAN.copy(), 2.0F, true);
        libShapeDraw.addShape(box);

        // Prefer a functional coding style? This is the equivalent of the above:
        //libShapeDraw = new LibShapeDraw().addShape(
        //        new WireframeCuboid(0,63,0, 1,64,1)
View Full Code Here


        // One other worthwhile sanity check is to call the verifyInitialized()
        // method, which ensures that ModLoader or Forge has successfully
        // initialized LibShapeDraw. See the method's Javadoc for more details.
        LibShapeDraw libShapeDraw = new LibShapeDraw().verifyInitialized();
        WireframeCuboid box = new WireframeCuboid(2,63,0, 3,64,1);
        box.setLineStyle(Color.ROYAL_BLUE.copy(), 2.0F, true);
        libShapeDraw.addShape(box);
    }
View Full Code Here

        libShapeDraw.addShape(sphere);
        rotate.animateStartLoop(360.0, false, 5000);
    }

    private void createColorShiftingShape() {
        WireframeCuboid box = new WireframeCuboid(8,63,2, 9,64,3);
        Color color = Color.CRIMSON.copy();
        box.setLineStyle(color, 3.0F, false);
        libShapeDraw.addShape(box);
        color.animateStartLoop(Color.MEDIUM_BLUE.copy().setAlpha(0.2), true, 750);

        // Prefer a functional coding style? This is the equivalent of the above:
        //libShapeDraw.addShape(
View Full Code Here

        //                .animateStartLoop(Color.MEDIUM_BLUE.copy().setAlpha(0.2), true, 750),
        //                3.0F, false));
    }

    private void createResizingShape() {
        WireframeCuboid box = new WireframeCuboid(8,63,4, 9,64,5);
        box.setLineStyle(Color.GOLD.copy(), 3.0F, true);
        ShapeScale scale = new ShapeScale(0.5, 1.0, 2.0);
        box.addTransform(scale);
        libShapeDraw.addShape(box);
        scale.animateStartLoop(2.0, 1.0, 0.5, true, 4500);

        // Since this is a simple WireframeCuboid, we could have animated
        // box.getLowerCorner() and box.getUpperCorner() instead of using a
View Full Code Here

        // If there are other mods using LibShapeDraw, this won't touch their
        // shapes. API instances are independent of each other.
        libShapeDraw.clearShapes();

        // Add a floating box that just follows the player around.
        followBox = new WireframeCuboid(0,0,0, 0,0,0); // actual coords will be set later
        followBox.setLineStyle(Color.CRIMSON.copy(), 3.0F, true);
        libShapeDraw.addShape(followBox);

        // Don't start spawning shapes until the player has been around at
        // least a couple seconds.
View Full Code Here

        //    Minecraft.thePlayer.rotationYaw/rotationPitch.
        //  - Add logic to only drop a shape if the player has moved far enough
        //    away from the last shape.
        long now = System.currentTimeMillis();
        if (now > lastShapeCreated + 500 && libShapeDraw.getShapes().size() - 1 < 30) {
            WireframeCuboid box = new WireframeCuboid(
                    event.getPlayerCoords().copy().subtract(BOX_RADIUS),
                    event.getPlayerCoords().copy().add(BOX_RADIUS));
            // gradually shift the color from opaque violet to transparent white
            double percent = (libShapeDraw.getShapes().size() - 1) / 30.0;
            box.setLineStyle(Color.DARK_VIOLET.copy().blend(Color.WHITE.copy().setAlpha(0.05), percent), 3.0F, false);
            libShapeDraw.addShape(box);
            lastShapeCreated = now;
        }
    }
View Full Code Here

        // Create the shape 3 blocks east of the player.
        //
        // We could (but won't, since this is a quick demo) get fancy and
        // adjust x/z based on Minecraft.thePlayer.rotationYaw so the box is
        // 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.
        //
View Full Code Here

TOP

Related Classes of libshapedraw.shape.WireframeCuboid

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.