camera: cache inverse tranform for huge speed up on ray_for_pixel.

WIP parallel render function.
This commit is contained in:
2021-07-17 23:16:12 -07:00
parent 2395c96e01
commit 538b8ad364
4 changed files with 47 additions and 6 deletions

View File

@@ -25,7 +25,7 @@ fn main() -> Result<()> {
let from = Tuple::point(0., 1.5, -5.);
let to = Tuple::point(0., 1., 0.);
let up = Tuple::point(0., 1., 0.);
camera.transform = view_transform(from, to, up);
camera.set_transform(view_transform(from, to, up));
let mut floor = Sphere::default();
floor.set_transform(Matrix4x4::scaling(10., 0.01, 10.));