# y.rb ruby-processing require 'cf3' Y_TOP = -1 / Math.sqrt(3) Y_BOT = Math.sqrt(3) / 6 def setup_the_triangle @triangle = ContextFree.define do ######## shape :start do unit brightness: 1.0 end shape :unit do triangle size: 1.0 split do unit size: 0.5, x: 0, y: Y_TOP/2, brightness: 0.8 rewind unit size: 0.5, x: -0.25, y: -Y_TOP/4, brightness: 0.8 rewind unit size: 0.5, x: 0.25, y: -Y_TOP/4, brightness: 0.8 end end ######## end end def setup size 1024, 1024 setup_the_triangle no_stroke color_mode RGB, 1 smooth draw_it save_frame("y.png") end def draw # Do nothing. end def draw_it background 225, 225, 0 @triangle.render :start, size: height, stop_size: 0.5, start_x: width/2, start_y: height * 0.6 end
Experiments with ruby-processing (processing-2.2.1) and JRubyArt for processing-3.0
Tuesday, 18 December 2012
New context_free.rb (cf3ruby)
Here is my "y" window sketch using my modified ruby-processing library (features CF3 syntax, ie shape replaces rule, also ruby 1.9 hash syntax).
Labels:
cf3,
context free DSL,
ruby-1.9,
ruby-processing
Subscribe to:
Post Comments (Atom)
Followers
Blog Archive
-
▼
2012
(26)
-
▼
December
(17)
- Bezier Patch as a VBO (PShape)
- Bezier Patch in ruby-processing
- Rotating Arcs Sketch in Ruby Processing
- Context free sketch in regular ruby processing
- Exporting cf3ruby directly to 'large' pdf
- Context Free Tree in cf3ruby
- New context_free.rb (cf3ruby)
- MeshToVBO conversion ruby-processing
- Fix for ruby-processing context free
- What works what does not and may not
- Retained Shape (FBO) in Ruby Processing
- Creating a Mock Vanilla Processing Distribution
- Landscape shader in ruby-processing
- Fish-eye shader revisited with ruby-processing and...
- PShader Example in ruby-processing
- A 3D-texture example with my hacked ruby-processing
- Testing ruby-processing with processing-2.0
-
▼
December
(17)
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