Reputation: 1
I am currently toying around with Noises, like Perlin and SimplexNoise. When I integrate the Noise function into my code, I get something that looks like static, which it clearly shouldn't be.
Here is my current code:
// Width and Height are screen width and height
// Pixelsize is 4
for (int x = 0; x < (width/pixelSize); x++) {
for (int y = 0; y < (height/pixelSize); y++) {
double newColor = SimplexNoise.noise(x, y);
if (newColor > 0) {
g.setColor(Color.black);
} else {
g.setColor(Color.WHITE);
}
g.fillRect(x*pixelSize, y*pixelSize, pixelSize, pixelSize);
}
}
The Noise I used is from here: https://github.com/SRombauts/SimplexNoise/blob/master/references/SimplexNoise.java
Upvotes: 0
Views: 52