From 8296be848319eecd43f94900d4d12414ec189166 Mon Sep 17 00:00:00 2001 From: Julian T Date: Wed, 3 Feb 2021 15:34:17 +0100 Subject: Add simple perspective camera --- src/main.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main.rs') 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()); } -- cgit v1.2.3