From 93b24b9d01f806cf69ecee86fada9e5b9bf06182 Mon Sep 17 00:00:00 2001 From: Rosyid Haryadi Date: Sun, 2 Mar 2025 16:56:59 +0700 Subject: material --- src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main.rs') 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(); -- cgit v1.2.3-70-g09d2