Sha256: d8eaf63245b361b7153bf394ef4bfdc91a39c823ae2295dafe01c14da628a7a5

Contents?: true

Size: 728 Bytes

Versions: 2

Compression:

Stored size: 728 Bytes

Contents

# Primitives 3D. 
# 
# Placing mathematically 3D objects in synthetic space.
# The lights() method reveals their imagined dimension.
# The box() and sphere() functions each have one parameter
# which is used to specify their size. These shapes are
# positioned using the translate() function.

class Primitives < Processing::App

  def setup
    
    size 640, 360, P3D
    
    background 0
    lights
    
    no_stroke
    push_matrix
    
    translate 130, height/2, 0
    rotate_y 1.25
    rotate_x -0.4
    
    box 100
    
    pop_matrix
    
    no_fill
    stroke 255
    push_matrix
    
    translate 500, height*0.35, -200
    sphere 280
    
    pop_matrix
    
  end
  
end

Primitives.new :title => "Primitives"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-processing-1.0.11 samples/processing_app/3D/form/primitives.rb
ruby-processing-1.0.10.1 samples/processing_app/3D/form/primitives.rb