diff --git a/vcg/space/index/grid_util.h b/vcg/space/index/grid_util.h index 79e32845..7077de73 100644 --- a/vcg/space/index/grid_util.h +++ b/vcg/space/index/grid_util.h @@ -107,10 +107,9 @@ public: template inline void IPiToPf(const Point3i & pi, Point3 &p ) const { - p[0] = ((OtherScalarType)pi[0])*voxel[0]; - p[1] = ((OtherScalarType)pi[1])*voxel[1]; - p[2] = ((OtherScalarType)pi[2])*voxel[2]; - p += bbox.min; + p[0] = bbox.min[0] + ((OtherScalarType)pi[0])*voxel[0]; + p[1] = bbox.min[1] + ((OtherScalarType)pi[1])*voxel[1]; + p[2] = bbox.min[2] + ((OtherScalarType)pi[2])*voxel[2]; } /* Returns the matrix that applied to a point in grid space * transforms it in the original space. diff --git a/wrap/gl/pick.h b/wrap/gl/pick.h index 4cc98703..f1b5f28c 100644 --- a/wrap/gl/pick.h +++ b/wrap/gl/pick.h @@ -217,7 +217,7 @@ public: float LocalEpsilon = 0.001f; for(size_t i =0;i=0 && p[0]=0 && p[1]