0

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.

output

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

Matt Ke
  • 3,599
  • 12
  • 30
  • 49
Snailtan
  • 1
  • 2

1 Answers1

0

Got it. I multiplied my x and y by 0.1, gave me my desired output! Yay!

Snailtan
  • 1
  • 2