patterns: implement object and pattern transformation awareness.

This commit is contained in:
2021-07-25 11:22:36 -07:00
parent bfa3282a37
commit 8b79876aee
5 changed files with 106 additions and 12 deletions

View File

@@ -44,7 +44,15 @@ fn main() -> Result<()> {
let point = r.position(hit.t);
let normal = hit.object.normal_at(point);
let eye = -r.direction;
let color = lighting(&hit.object.material, &light, point, eye, normal, in_shadow);
let color = lighting(
&hit.object.material,
&hit.object,
&light,
point,
eye,
normal,
in_shadow,
);
c.set(x, y, color);
}
}