Package java.util

Examples of java.util.Random.nextFloat()


      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 (y = 0; y < height; y++)
            {
                rstr.getPixel(x, y, oldColor);

                // hard noise
                vColor[0] = 0 + (int) (Math.floor(vRandom.nextFloat() * 1.03) * 255);
                // soft noise
                vColor[0] = vColor[0]
                        ^ (170 + (int) (vRandom.nextFloat() * 80));
                // xor to image
                vColor[0] = vColor[0] ^ oldColor[0];
View Full Code Here

                // hard noise
                vColor[0] = 0 + (int) (Math.floor(vRandom.nextFloat() * 1.03) * 255);
                // soft noise
                vColor[0] = vColor[0]
                        ^ (170 + (int) (vRandom.nextFloat() * 80));
                // xor to image
                vColor[0] = vColor[0] ^ oldColor[0];
                vColor[1] = vColor[0];
                vColor[2] = vColor[0];

View Full Code Here

            r = new Workout();
            c.set(Calendar.HOUR_OF_DAY,
                    12 + (rnd.nextInt(11) - rnd.nextInt(11)));
            r.setDate(c.getTime());
            r.setTitle(titles[rnd.nextInt(titles.length)]);
            r.setKilometers(Math.round(rnd.nextFloat() * 30));
            r.setTrainingType("tt");
            c.add(Calendar.DATE, 1);
            cont.addBean(r);
        }
    }
View Full Code Here

    }
  }

  public static Color randomColor() {
    Random random = new Random();
    return new Color(random.nextFloat(), random.nextFloat(), random.nextFloat(), 1.f);
  }
}
View Full Code Here

    }
  }

  public static Color randomColor() {
    Random random = new Random();
    return new Color(random.nextFloat(), random.nextFloat(), random.nextFloat(), 1.f);
  }
}
View Full Code Here

    }
  }

  public static Color randomColor() {
    Random random = new Random();
    return new Color(random.nextFloat(), random.nextFloat(), random.nextFloat(), 1.f);
  }
}
View Full Code Here

    if (index == this.items.size()) {
      if (!LogicUtil.nullOrEmpty(stack)) {
        // Spawn new item for this item stack
        Random random = WorldUtil.getRandom(this.location.getWorld());
        Location spawnLoc = this.location.clone().add(-0.45, -0.45, -0.45);
        spawnLoc = spawnLoc.add(0.9f * random.nextFloat(), 0.9f * random.nextFloat(), 0.9f * random.nextFloat());
        Item item = location.getWorld().dropItem(spawnLoc, stack);
        item.setVelocity(new Vector(0, 0, 0));
        this.items.add(item);
      }
    } else {
View Full Code Here

    if (index == this.items.size()) {
      if (!LogicUtil.nullOrEmpty(stack)) {
        // Spawn new item for this item stack
        Random random = WorldUtil.getRandom(this.location.getWorld());
        Location spawnLoc = this.location.clone().add(-0.45, -0.45, -0.45);
        spawnLoc = spawnLoc.add(0.9f * random.nextFloat(), 0.9f * random.nextFloat(), 0.9f * random.nextFloat());
        Item item = location.getWorld().dropItem(spawnLoc, stack);
        item.setVelocity(new Vector(0, 0, 0));
        this.items.add(item);
      }
    } else {
View Full Code Here

    if (index == this.items.size()) {
      if (!LogicUtil.nullOrEmpty(stack)) {
        // Spawn new item for this item stack
        Random random = WorldUtil.getRandom(this.location.getWorld());
        Location spawnLoc = this.location.clone().add(-0.45, -0.45, -0.45);
        spawnLoc = spawnLoc.add(0.9f * random.nextFloat(), 0.9f * random.nextFloat(), 0.9f * random.nextFloat());
        Item item = location.getWorld().dropItem(spawnLoc, stack);
        item.setVelocity(new Vector(0, 0, 0));
        this.items.add(item);
      }
    } else {
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.