Here is a simple sketch, that flashes new random voronoi cells, with random fill.
load_libraries 'mesh' # http://www.leebyron.com/else/mesh/
import 'megamu.mesh.Voronoi'
require 'set'
attr_reader :voronoi, :points
def setup()
size(300, 300)
color_mode HSB, 1.0
end
def draw
points = Set.new
10.times do
10.times do
points.add([rand*300, rand*300])
end
end
voronoi = Voronoi.new((points.to_a).to_java(Java::float[]))
regions = voronoi.get_regions
regions.each do |region|
region_coordinates = region.get_coords
fill(rand, rand, rand)
region.draw(self)
end
end
Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0
Saturday, 8 May 2010
Subscribe to:
Post Comments (Atom)
Followers
Blog Archive
-
▼
2010
(73)
-
▼
May
(9)
- Towards Penrose Tiling Using ruby-processing conte...
- Ruby Processing Context Free DSL (how to do a cfdg...
- Colored Penrose Tiling using LSystems
- Op Art using Voronoi Cell, Ruby Processing
- Voronoi Cells from the Coordinates of A Penrose Ti...
- Random Voronoi Sketch
- A Simple flower using ruby processing context free...
- Custom hbar shape for ruby processing Context Free...
- Penrose Tiling Ruby-Processing LSystems
-
▼
May
(9)
About Me
- monkstone
- I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2
No comments:
Post a Comment