See source code You will need maven to build (no other dependencies)
Created
August 27, 2021 07:23
-
-
Save monkstone/8ea901194bd230e18f21500789ee0bf6 to your computer and use it in GitHub Desktop.
uniform_noise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'picrate' | |
class UniformNoiseTest < Processing::App | |
load_library :uniform_noise | |
java_import 'micycle.uniformnoise.UniformNoise' | |
java_import 'java.awt.Color' | |
OCTAVES = 4 | |
def setup | |
sketch_title 'Uniform Noise Test' | |
load_pixels | |
@unoise = UniformNoise.new | |
end | |
def draw | |
grid(width, height) do |x, y| | |
val = if x < width / 2 | |
(SmoothNoise.noise(x * 0.015, y * 0.015, frame_count * 0.035) + 1) / 2 | |
else | |
@unoise.uniform_noise(x * 0.0085, y * 0.0085, frame_count * 0.01, OCTAVES, 0.5) | |
end | |
pixels[y * width + x] = Color.HSBtoRGB(val, 1, 1) | |
end | |
update_pixels | |
end | |
def settings | |
size(800, 800, P2D) | |
end | |
end | |
UniformNoiseTest.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment