From 0d5e6bd9363d5ed5c4f28174819fc0f5fd9aa586 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sat, 6 Feb 2021 17:27:42 +0100 Subject: Reorganized scene module, and fixed bug in sphere intersect --- src/trace/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/trace/mod.rs') diff --git a/src/trace/mod.rs b/src/trace/mod.rs index 90f12da..9c8b0b8 100644 --- a/src/trace/mod.rs +++ b/src/trace/mod.rs @@ -19,8 +19,7 @@ impl NormTracer { pub fn trace(&self, scn: &Scene, ray: &Ray) -> Spectrum { // Trace ray if let Some(i) = scn.intersect(ray) { - let p = ray.at(i.t); - let norm = i.shp.norm_at(&p) * 0.5 + Vector3f::new(0.5); + let norm = i.n * 0.5 + Vector3f::new(0.5); return Spectrum::new_rgb(norm.x, norm.y, norm.z); } -- cgit v1.2.3