Skip to content

Commit 3916631

Browse files
committed
Update noise examples
1 parent 9b075b7 commit 3916631

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

processing_app/basics/math/noise4_tap.rb

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ def setup
1717
background(0)
1818
stroke(255)
1919
fill(32, 255, 64)
20-
noise_mode(Propane::SIMPLEX)
2120
@half_w = width * 0.5
2221
@half_h = height * 0.5
2322
@radius = height * 0.4
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
require 'propane'
2+
# OpenSimplex has a range -1.0 to 1.0
3+
class NoiseImage < Propane::App
4+
SCALE = 0.02
5+
6+
def setup
7+
sketch_title 'Noise Image'
8+
background(0)
9+
stroke(255)
10+
no_fill
11+
end
12+
13+
def draw
14+
background(0)
15+
scale = 0.02
16+
load_pixels
17+
grid(500, 500) do |x, y|
18+
col = noise(SCALE * x, SCALE * y) > 0 ? 255 : 0
19+
pixels[x + width * y] = color(col, 0, 0)
20+
end
21+
update_pixels
22+
save(data_path('noise_image.png'))
23+
end
24+
25+
def settings
26+
size 500, 500
27+
end
28+
end
29+
30+
NoiseImage.new
+15
Loading

0 commit comments

Comments
 (0)