ft: 12: movable camera + camera init overhaul

This commit is contained in:
djaidjai committed 2026-04-25 03:55:44 +02:00
1 parent ffad2f12e4
commit 5f2c419af5
3 files changed
+118 -33

No files matched your search

+7 -1
View File
@@ -37,6 +37,12 @@ fn main() {
world.push(Sphere::xyz(1., 0., -1.0, 0.5, right.clone()));
world.push(Sphere::xyz(0., 0.7, -0.4, 0.2, blue.clone()));
let c = Camera::new(16. / 9., 1920, 3, 50);
let mut c = Camera::new(400, 300);
// let mut c = Camera::new(1920, 1080);
c.set_fov(20.);
c.set_anti_alias_rate(2);
c.set_max_depth(90);
c.set_look_from(Vec3::new(-2., 2., 1.));
c.set_look_at(Vec3::new(0., 0., -1.));
c.render(&world);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.