From ecfea251b90a6891232ef0db57d3070bfb1a7e71 Mon Sep 17 00:00:00 2001 From: JoKhannn <141194340+JoKhannn@users.noreply.github.com> Date: Tue, 29 Oct 2024 16:36:30 -0400 Subject: [PATCH] Update lib.rs --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 3de4915d..2b8d7568 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2615,7 +2615,7 @@ pub fn pinhole_depth( cam_transform: [f32; 9], depth_image: &[f32], ) -> Result<(), SimulationError> { - let fov_x = (width as f32 / height as f32).atan() * 2.0; + let fov_x = (width as f32 / height as f32 * (fov / 2.0).tan()).atan() * 2.0; let horizontal_focal_length = (width as f32 / 2.0) / ((fov_x/ 2.0).tan()); let vertical_focal_length = (height as f32 / 2.0) / ((fov / 2.0).tan()); let pinhole_camera = rerun::Pinhole::from_focal_length_and_resolution(