Track a specific sphere

This commit is contained in:
numzero 2024-12-30 19:32:38 +03:00
parent fe998585b4
commit d91346f605

View File

@ -143,9 +143,10 @@ fn main() {
for _ in 0..RAYS_PER_PIXEL {
frame += 1;
let time = frame as f32 / (60. * RAYS_PER_PIXEL as f32);
let target = sphere_params[0].to_sphere(time - 0.2).center;
let eye = camera_params.to_sphere(time).center;
let right = camera_params.deriv(time);
let forward = target_params.to_sphere(time).center - eye;
let forward = target - eye;
let viewport = make_viewport(size.width, size.height);
let location = convert_location(CamLoc { eye, forward, right });
let spheres: Vec<_> = sphere_params.iter().map(|p| p.to_sphere(time)).collect();
@ -163,7 +164,7 @@ fn main() {
viewport,
trace::Aperture {
radius: 0.001,
focal_distance: std::f32::INFINITY,
focal_distance: forward.length(),
},
location,
);