From 401da63c2245cd2f52bd5e727aa8e60112efc701 Mon Sep 17 00:00:00 2001 From: David Rose Date: Sun, 15 Jan 2012 23:21:08 +0000 Subject: [PATCH] OSphereLens shouldn't scale vertical component by focal_length. --- panda/src/distort/oSphereLens.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/panda/src/distort/oSphereLens.cxx b/panda/src/distort/oSphereLens.cxx index 38144828b0..8672766725 100755 --- a/panda/src/distort/oSphereLens.cxx +++ b/panda/src/distort/oSphereLens.cxx @@ -68,8 +68,8 @@ do_extrude(const Lens::CData *lens_cdata, near_point = (v * do_get_near(lens_cdata)); far_point = (v * do_get_far(lens_cdata)); - near_point[2] = f[1] / focal_length; - far_point[2] = f[1] / focal_length; + near_point[2] = f[1]; + far_point[2] = f[1]; // And we'll need to account for the lens's rotations, etc. at the // end of the day. @@ -121,8 +121,7 @@ do_project(const Lens::CData *lens_cdata, const LPoint3 &point3d, LPoint3 &point // The x position is the angle about the Z axis. rad_2_deg(catan2(xy[0], xy[1])) * focal_length / ospherical_k, // The y position is the Z height. - // distance. - p[2] * focal_length, + p[2], // Z is the distance scaled into the range (1, -1). (do_get_near(lens_cdata) - dist) / (do_get_far(lens_cdata) - do_get_near(lens_cdata)) );