noise

概要

p5.jsリファレンス(参考情報)

[p5.js] noise

サンプル

def setup
  @xoff = 0.0
end

def draw
  background(204)
  @xoff = @xoff + 0.01
  n = noise(@xoff) * width
  line(n, 0, n, height)
end
def setup
  @noiseScale=0.02
end

def draw
  background(255)
  (0...width).each do |x|
    noiseVal = noise((mouseX + x) * @noiseScale, mouseY * @noiseScale)
    stroke(noiseVal * 255)
    line(x, mouseY + noiseVal * 80, x, height)
  end
end

構文

戻値