osgUtil :: PolygonIntersector polyhedral model Intersection

osg3.4 version of a problem, especially in a large triangle containing a portion of the polyhedron, his calculation is a calculation of each side of the triangle intersection with the polyhedron, this situation can not be calculated triangular polyhedron covered portions of the interior

osg3.6.4 updated version of the calculation method, but there is a Bug, you need to modify PolygonIntersectorUtil :: IntersectFunctor :: contains (), followed dest.swap (src), add:

src.push_back(src.front());

That new calculation of points need to form a closed loop, otherwise incorrect results

Guess you like

Origin www.cnblogs.com/coolbear/p/12636156.html