From b976ce98be7275bf92e01f6c86bf2b694530481e Mon Sep 17 00:00:00 2001 From: Nat Lasseter Date: Thu, 13 Jun 2024 13:24:53 +0100 Subject: Done C10, Materials --- rtiaw | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'rtiaw') diff --git a/rtiaw b/rtiaw index 82e4303..71b4fbd 100755 --- a/rtiaw +++ b/rtiaw @@ -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) -- cgit v1.2.3