|
Welzl's Minimum Sphere Algorithm Demystified
IntroductionSpheres are among the most common geometric entities used in performing various game engine related tasks such as object culling, containment, bounding volumes and bounding volume hierarchies to name a few. Spheres are excellent candidates for bounding volumes and are widely used mainly because they have inexpensive intersection tests, are easy to transform (they are rotation-invariant) and have small memory usage. Unfortunately, axis-aligned bounding boxes are often preferred over spheres due to fitting problems or the fact that a tight fitting sphere is hard to compute in real time. In this article we'll explore what is considered the optimal solution to the sphere fitting problem, a solution proposed by Emo Welzl [Welzl91]. For simplicity we'll limit ourselves to the discussion and implementation of the algorithm in 2D only, although the algorithm scales quite nicely to 3D. A simple Java-based implementation of the sphere generation algorithm is provided. The code is described later on in the article. The problem of finding an optimal sphereThere are many algorithms to compute an enclosing sphere of a set of points. Most of the algorithms may be easy to implement and understand but fail to provide optimal spheres in most cases. A description of some of the basic algorithms and their shortcomings is listed below:
|