Browse Source

workaround for some artifacts with missing points in distortion map

David Rose 11 years ago
parent
commit
df33105e30
1 changed files with 7 additions and 1 deletions
  1. 7 1
      panda/src/distort/projectionScreen.cxx

+ 7 - 1
panda/src/distort/projectionScreen.cxx

@@ -596,8 +596,14 @@ recompute_geom(Geom *geom, const LMatrix4 &rel_mat) {
       LPoint3f p;
       LPoint3f p;
       if (!_undist_lut.calc_bilinear_point(p, uvw[0], 1.0 - uvw[1])) {
       if (!_undist_lut.calc_bilinear_point(p, uvw[0], 1.0 - uvw[1])) {
         // Point is missing.
         // Point is missing.
-        uvw.set(0, 0, 0);
+
+        // We're better off keeping the point where it is,
+        // undistorted--it's probably close to where it should
+        // be--than we are changing it arbitrarily to (0, 0), which
+        // might be far away from where it should be.
+        //uvw.set(0, 0, 0);
         good = false;
         good = false;
+
       } else {
       } else {
         uvw = LCAST(PN_stdfloat, p);
         uvw = LCAST(PN_stdfloat, p);
         uvw[1] = 1.0 - uvw[1];
         uvw[1] = 1.0 - uvw[1];