Sha256: 3af3b223445564d250b05c7f2c6c5635a01da14662b71e75307b52bdc95a0274

Contents?: true

Size: 434 Bytes

Versions: 10

Compression:

Stored size: 434 Bytes

Contents

# Reflection 
# by Simon Greenwold. 
# 
# Vary the specular reflection component of a material
# with the horizontal position of the mouse. 



def setup
  
  size 640, 360, P3D
  
  no_stroke
  color_mode RGB, 1
  fill 0.4
  
end

def draw
  
  background 0
  
  translate width/2, height/2
  
  light_specular 1, 1, 1
  directional_light 0.8, 0.8, 0.8, 0, 0, -1
  
  s = mouse_x / width.to_f
  
  specular s
  
  sphere 120
  
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-processing-2.6.3 samples/processing_app/basics/lights/reflection.rb
ruby-processing-2.6.2 samples/processing_app/basics/lights/reflection.rb
ruby-processing-2.6.1 samples/processing_app/basics/lights/reflection.rb
ruby-processing-2.6.0 samples/processing_app/basics/lights/reflection.rb
ruby-processing-2.5.1 samples/processing_app/basics/lights/reflection.rb
ruby-processing-2.5.0 samples/processing_app/basics/lights/reflection.rb
ruby-processing-2.4.4 samples/processing_app/basics/lights/reflection.rb
ruby-processing-2.4.3 samples/processing_app/basics/lights/reflection.rb
ruby-processing-2.4.2 samples/processing_app/basics/lights/reflection.rb
ruby-processing-2.4.1 samples/processing_app/basics/lights/reflection.rb