Sha256: b5edc0ee63b8c2b4fc2ac64cc67f636ac8ff323f85861756429ffc598417f5ac

Contents?: true

Size: 580 Bytes

Versions: 2

Compression:

Stored size: 580 Bytes

Contents

# Rotate2

class Rotate2 < Processing::App

  def setup
    
    size 640, 360, P3D
    
    @num = 12
    @colors = []
    @a = 0.0
    @offset = PI/24
    
    no_stroke
    lights
    
    1.upto(@num) { |i|
    	@colors.push color 255 * i / @num
    }
    
  end
  
  def draw
  
  	background 0, 0, 26
  	
  	translate width/2, height/2
  	
  	@a += 0.01
  	
  	@colors.each_with_index { |c, i| 
  		push_matrix
  			fill c
  			rotate_y @a + @offset * i
  			rotate_x @a/2 + @offset * i
  			
  			box 200
  		pop_matrix
  	}
  
  end
  
end

Rotate2.new :title => "Rotate2"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-processing-1.0.11 samples/processing_app/3D/transform/rotate2.rb
ruby-processing-1.0.10.1 samples/processing_app/3D/transform/rotate2.rb