Sha256: f02eec281bf3e892f4319e27f6e3f84ea4d0c8f3468a0204fd3532abd4098d96

Contents?: true

Size: 469 Bytes

Versions: 2

Compression:

Stored size: 469 Bytes

Contents

# Noise1D. 
# 
# Using 1D Perlin Noise to assign location. 

class Noise1D < Processing::App

  def setup
    
    size 200, 200
    
    @xoff = 0.0
    @x_increment = 0.01
    
    background 0
    frame_rate 30
    smooth
    no_stroke
    
  end
  
  def draw
  
  	fill 0, 10
  	rect 0, 0, width, height
  	
  	n = noise( @xoff ) * width
  	
  	@xoff += @x_increment
  	
  	fill 200
  	ellipse n, height/2, 16, 16
  
  end
  
end

Noise1D.new :title => "Noise 1 D"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-processing-1.0.11 samples/processing_app/basics/math/noise_1_d.rb
ruby-processing-1.0.10.1 samples/processing_app/basics/math/noise_1_d.rb