diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 73888c2..7c6c8f1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,10 +4,12 @@ mod calculus; mod camera; mod object; mod interval; +mod material; use crate::calculus::calculus::Point3; use crate::common::*; use crate::camera::Camera; +use crate::material::{Material, MaterialType}; use crate::object::{HittableList, Sphere}; use crate::view::{render_viewer, View}; @@ -16,11 +18,15 @@ fn main() { let mut world = HittableList::new(); world.push( - Sphere::new(Point3::new(0.0, 0.0, -1.0), 0.5) + Sphere::new(Point3::new(0.6, -0.3, -1.0), 0.3, MaterialType::Metal, Color::new(0.8, 0.0, 0.0)) ); world.push( - Sphere::new(Point3::new(0.0, -100.5, -1.0), 100.0) + Sphere::new(Point3::new(0.0, 0.0, -1.0), 0.5, MaterialType::Diffuse, Color::new(0.4, 0.4, 0.4)) + ); + + world.push( + Sphere::new(Point3::new(0.0, -100.5, -1.0), 100.0, MaterialType::Diffuse, Color::new(0.2, 0.2, 0.2)) ); let camera = Camera::new(); |