aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-02-03 15:34:17 +0100
committerJulian T <julian@jtle.dk>2021-02-03 15:34:17 +0100
commit8296be848319eecd43f94900d4d12414ec189166 (patch)
treed0adad5c05692a55e2957d02eb62666bd45e011f /src/main.rs
parent32e719a517a6fea113f3e66e350c9aa60ddd98b9 (diff)
Add simple perspective camera
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 524f613..22998dd 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,4 +1,17 @@
+use pathtrace::camera::Camera;
+use pathtrace::core::{Vector3f, Vector2f};
fn main() {
+
+ let cam = Camera::new(
+ Vector3f::new(10.0),
+ Vector3f::new(0.0),
+ Vector3f::new_xyz(0.0, 1.0, 0.0),
+ 90.0, Vector2f::new(10.0),
+ );
+
+ let (r, _) = cam.generate_ray(Vector2f::new(5.0));
+
+ println!("r: {}, norm: {}", r.direction, r.direction.norm());
}