You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The inverse of projection matrices can be computed analytically and evaluated directly from the same input parameters for improved performance and precision. For example, the inverse of perspective_rh would be something like:
pubfnperspective_rh_inv(fov_y_radians:f32,aspect_ratio:f32,z_near:f32,z_far:f32) -> Self{glam_assert!(z_near > 0.0 && z_far > 0.0);let(sin_fov, cos_fov) = (0.5* fov_y_radians).sin_cos();let h = sin_fov / cos_fov;let w = h * aspect_ratio;let r = 1.0 / z_near;Self::from_cols(Vec4::new(w,0.0,0.0,0.0),Vec4::new(0.0, h,0.0,0.0),Vec4::new(0.0,0.0,0.0,1.0/z_far - r),Vec4::new(0.0,0.0, -1.0, r),)}
The text was updated successfully, but these errors were encountered:
The inverse of projection matrices can be computed analytically and evaluated directly from the same input parameters for improved performance and precision. For example, the inverse of
perspective_rh
would be something like:The text was updated successfully, but these errors were encountered: