Sha256: b3330e313a74c794dff25285998561e0ebf70970f8d2435f74b67c8b1b9e30a5

Contents?: true

Size: 542 Bytes

Versions: 9

Compression:

Stored size: 542 Bytes

Contents

# Spot. 
# 
# Move the mouse the change the position and concentation
# of a blue spot light. 



def setup
  
  size 640, 360, P3D
  
  @concentration = 600 # try values between 1 <-> 10000
  
  no_stroke
  fill 204
  smooth(8)
  sphere_detail 60
  
end

def draw
  
  background 0
  
  directional_light 51, 102, 126, 0, -1, 0
  
  spot_light 204, 153, 0, 360, 160, 600, 0, 0, -1, PI/2, @concentration
  
  spot_light 102, 153, 204, 360, mouse_y, 600, 0, 0, -1, PI/2, @concentration
  
  translate width/2, height/2
  
  sphere 120
  
end

Version data entries

9 entries across 9 versions & 1 rubygems

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