diff options
| author | Sakarias Johansson <sakarias.johansson@goodbyekansas.com> | 2023-04-16 14:32:42 +0200 |
|---|---|---|
| committer | Sakarias Johansson <sakariasjohansson@hotmail.com> | 2023-04-16 15:03:31 +0200 |
| commit | c7cbd0d288083ad7ae132ac6627cf93ec5b3aed5 (patch) | |
| tree | 421da75f8beae04ebfd42b1abb10810ab6eafa55 /racer-tracer/src/main.rs | |
| parent | 8201c8e2a7ff85383ff7606513778253aae7e666 (diff) | |
| download | racer-tracer-c7cbd0d288083ad7ae132ac6627cf93ec5b3aed5.tar.gz racer-tracer-c7cbd0d288083ad7ae132ac6627cf93ec5b3aed5.tar.xz racer-tracer-c7cbd0d288083ad7ae132ac6627cf93ec5b3aed5.zip | |
✨ Add support for camera configuration
Also decided to not use glam and just do the math myself.
Just didn't want an entire library for such a small thing.
Probably goint to replace Vec3 at some point, just not now.
Diffstat (limited to 'racer-tracer/src/main.rs')
| -rw-r--r-- | racer-tracer/src/main.rs | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/racer-tracer/src/main.rs b/racer-tracer/src/main.rs index afdc919..16fe6c4 100644 --- a/racer-tracer/src/main.rs +++ b/racer-tracer/src/main.rs @@ -35,10 +35,7 @@ use structopt::StructOpt; use synchronoise::SignalEvent; use terminal::Terminal; -use crate::{ - scene_controller::{interactive::InteractiveScene, SceneController, SceneData}, - vec3::Vec3, -}; +use crate::scene_controller::{interactive::InteractiveScene, SceneController, SceneData}; use crate::{ camera::Camera, @@ -51,20 +48,7 @@ use crate::{ fn run(config: Config, log: Logger, term: Terminal) -> Result<(), TracerError> { info!(log, "Starting racer-tracer {}", env!("CARGO_PKG_VERSION")); let image = image::Image::new(config.screen.width, config.screen.height); - let look_from = Vec3::new(13.0, 2.0, 3.0); - let look_at = Vec3::new(0.0, 0.0, 0.0); - // TODO: Make camera configurable. - // pos, look_at, fov, aperture, focus distance. - // Also ensure those can be changed during runtime. - let camera = Camera::new( - look_from, - look_at, - Vec3::new(0.0, 1.0, 0.0), - 20.0, - &image, - 0.1, - 10.0, - ); + let camera = Camera::from((&image, &config.camera)); let scene = Scene::try_new(&config.loader)?; let mut window_res: Result<(), TracerError> = Ok(()); let mut render_res: Result<(), TracerError> = Ok(()); |
