Package java.util

Examples of java.util.Random.nextFloat()


        for (int i = 0; i < points.length; i++) {
            // Set the point at the array index to
            // x = random between -50 and +50
            // y = random between -50 and +50
            // z = random between  0  and -200
            points[i] = new Point((random.nextFloat() - 0.5f) * 100f, (random.nextFloat() - 0.5f) * 100f,
                    random.nextInt(200) - 200);
        }
        // The speed in which the "camera" travels
        float speed = 0.0f;
        //
View Full Code Here


        for (int i = 0; i < points.length; i++) {
            // Set the point at the array index to
            // x = random between -50 and +50
            // y = random between -50 and +50
            // z = random between  0  and -200
            points[i] = new Point((random.nextFloat() - 0.5f) * 100f, (random.nextFloat() - 0.5f) * 100f,
                    random.nextInt(200) - 200);
        }
        // The speed in which the "camera" travels
        float speed = 0.0f;
        //
View Full Code Here

        Box(int x, int y) {
            this.x = x;
            this.y = y;

            Random randomGenerator = new Random();
            colorRed = randomGenerator.nextFloat();
            colorBlue = randomGenerator.nextFloat();
            colorGreen = randomGenerator.nextFloat();
        }

        boolean isInBounds(int mouseX, int mouseY) {
View Full Code Here

            this.x = x;
            this.y = y;

            Random randomGenerator = new Random();
            colorRed = randomGenerator.nextFloat();
            colorBlue = randomGenerator.nextFloat();
            colorGreen = randomGenerator.nextFloat();
        }

        boolean isInBounds(int mouseX, int mouseY) {
            return mouseX > x && mouseX < x + 50 && mouseY > y && mouseY < y + 50;
View Full Code Here

            this.y = y;

            Random randomGenerator = new Random();
            colorRed = randomGenerator.nextFloat();
            colorBlue = randomGenerator.nextFloat();
            colorGreen = randomGenerator.nextFloat();
        }

        boolean isInBounds(int mouseX, int mouseY) {
            return mouseX > x && mouseX < x + 50 && mouseY > y && mouseY < y + 50;
        }
View Full Code Here

            y += dy;
        }

        void randomiseColors() {
            Random randomGenerator = new Random();
            colorRed = randomGenerator.nextFloat();
            colorBlue = randomGenerator.nextFloat();
            colorGreen = randomGenerator.nextFloat();
        }

        void draw() {
View Full Code Here

        }

        void randomiseColors() {
            Random randomGenerator = new Random();
            colorRed = randomGenerator.nextFloat();
            colorBlue = randomGenerator.nextFloat();
            colorGreen = randomGenerator.nextFloat();
        }

        void draw() {
            glColor3f(colorRed, colorGreen, colorBlue);
View Full Code Here

        void randomiseColors() {
            Random randomGenerator = new Random();
            colorRed = randomGenerator.nextFloat();
            colorBlue = randomGenerator.nextFloat();
            colorGreen = randomGenerator.nextFloat();
        }

        void draw() {
            glColor3f(colorRed, colorGreen, colorBlue);
            glBegin(GL_QUADS);
View Full Code Here

      Random colorRandom = new Random(0);
     
      for (VectorXYZ p : points) {
       
        g.setColor(new Color(
            0.5f + colorRandom.nextFloat() / 2,
            0.5f + colorRandom.nextFloat() / 2,
            0.5f + colorRandom.nextFloat() / 2));
       
        for (TriangleXZ t : triangulation.getVoronoiCellSectors(p)) {
          fill(g, t);
View Full Code Here

     
      for (VectorXYZ p : points) {
       
        g.setColor(new Color(
            0.5f + colorRandom.nextFloat() / 2,
            0.5f + colorRandom.nextFloat() / 2,
            0.5f + colorRandom.nextFloat() / 2));
       
        for (TriangleXZ t : triangulation.getVoronoiCellSectors(p)) {
          fill(g, t);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.