diff options
Diffstat (limited to 'rtiaw')
-rwxr-xr-x | rtiaw | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -1,15 +1,23 @@ #!/usr/bin/env ruby -$LOAD_PATH.unshift File.dirname(__FILE__) + '/lib' +$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib')) require 'interval' require 'vec3' require 'ray' require 'hittable' require 'camera' +require 'material' + +mat_ground = Lambertian.new(0.8, 0.8, 0.0) +mat_centre = Lambertian.new(0.1, 0.2, 0.5) +mat_left = Metal.new(0.8, 0.8, 0.8, 0.3) +mat_right = Metal.new(0.8, 0.6, 0.2, 1.0) world = Hittables.new -world << Sphere.new(0,0,-1, 0.5) -world << Sphere.new(0,-100.5,-1, 100) +world << Sphere.new(0, -100.5, -1, 100, mat_ground) +world << Sphere.new(0, 0, -1, 0.5, mat_centre) +world << Sphere.new(-1, 0, -1, 0.5, mat_left) +world << Sphere.new(1, 0, -1, 0.5, mat_right) camera = Camera.new(400, 16.0 / 9) camera.render(world) |