Bounding Region
   HOME

TheInfoList



OR:

In
computer graphics Computer graphics deals with generating images and art with the aid of computers. Computer graphics is a core technology in digital photography, film, video games, digital art, cell phone and computer displays, and many specialized applications. ...
and computational geometry, a bounding volume (or bounding region) for a set of objects is a closed region that completely contains the union of the objects in the set. Bounding volumes are used to improve the efficiency of geometrical operations, such as by using simple regions, having simpler ways to
test for overlap This is a glossary of terms relating to computer graphics. For more general computer hardware terms, see glossary of computer hardware terms. 0–9 A B ...
. A bounding volume for a set of objects is also a bounding volume for the single object consisting of their union, and the other way around. Therefore, it is possible to confine the description to the case of a single object, which is assumed to be non-empty and bounded (finite).


Uses

Bounding volumes are most often used to accelerate certain kinds of tests. In ray tracing, bounding volumes are used in ray-intersection tests, and in many
rendering algorithm Rendering is the process of generating a photorealistic or non-photorealistic image from input data such as 3D models. The word "rendering" (in one of its senses) originally meant the task performed by an artist when depicting a real or imag ...
s, they are used for
viewing frustum In 3D computer graphics, a viewing frustum or view frustum is the region of space in the modeled world that may appear on the screen; it is the field of view of a perspective virtual camera system. The view frustum is typically obtained by t ...
tests. If the ray or viewing frustum does not intersect the bounding volume, it cannot intersect the object contained within, allowing trivial rejection. Similarly if the frustum contains the entirety of the bounding volume, the contents may be trivially accepted without further tests. These intersection tests produce a list of objects that must be 'displayed' (rendered;
rasterized In computer graphics, rasterisation (British English) or rasterization (American English) is the task of taking an image described in a vector graphics format (shapes) and converting it into a raster image (a series of pixels, dots or lines, whic ...
). In
collision detection Collision detection is the computational problem of detecting an intersection of two or more objects in virtual space. More precisely, it deals with the questions of ''if'', ''when'' and ''where'' two or more objects intersect. Collision detect ...
, when two bounding volumes do not intersect, the contained objects cannot collide. Testing against a bounding volume is typically much faster than testing against the object itself, because of the bounding volume's simpler geometry. This is because an 'object' is typically composed of polygons or data structures that are reduced to polygonal approximations. In either case, it is computationally wasteful to test each polygon against the view volume if the object is not visible. (Onscreen objects must be 'clipped' to the screen, regardless of whether their surfaces are actually visible.) To obtain bounding volumes of complex objects, a common way is to break the objects/scene down using a
scene graph A scene graph is a general data structure commonly used by vector-based graphics editing applications and modern computer games, which arranges the logical and often spatial representation of a graphical scene. It is a collection of nodes in a g ...
or more specifically a
bounding volume hierarchy A bounding volume hierarchy (BVH) is a tree structure on a set of geometric objects. All geometric objects, which form the leaf nodes of the tree, are wrapped in bounding volumes. These nodes are then grouped as small sets and enclosed within lar ...
, like e.g. OBB trees. The basic idea behind this is to organize a scene in a tree-like structure where the root comprises the whole scene and each leaf contains a smaller subpart. In
computer stereo vision Computer stereo vision is the extraction of 3D information from digital images, such as those obtained by a CCD camera. By comparing information about a scene from two vantage points, 3D information can be extracted by examining the relative positi ...
, a bounding volume reconstructed from silhouettes of an object is known as a " visual hull."


Common types

The choice of the type of bounding volume for a given application is determined by a variety of factors: the computational cost of computing a bounding volume for an object, the cost of updating it in applications in which the objects can move or change shape or size, the cost of determining intersections, and the desired precision of the intersection test. The precision of the intersection test is related to the amount of space within the bounding volume not associated with the bounded object, called ''void space''. Sophisticated bounding volumes generally allow for less void space but are more computationally expensive. It is common to use several types in conjunction, such as a cheap one for a quick but rough test in conjunction with a more precise but also more expensive type. The types treated here all give
convex Convex or convexity may refer to: Science and technology * Convex lens, in optics Mathematics * Convex set, containing the whole line segment that joins points ** Convex polygon, a polygon which encloses a convex set of points ** Convex polytop ...
bounding volumes. If the object being bounded is known to be convex, this is not a restriction. If non-convex bounding volumes are required, an approach is to represent them as a union of a number of convex bounding volumes. Unfortunately, intersection tests become quickly more expensive as the bounding boxes become more sophisticated. A ''
bounding box In geometry, the minimum bounding box or smallest bounding box (also known as the minimum enclosing box or smallest enclosing box) for a point set in dimensions is the box with the smallest measure (area, volume, or hypervolume in higher dime ...
'' or ''minimum bounding box'' (''MBB'') is a
cuboid In geometry, a cuboid is a hexahedron with quadrilateral faces, meaning it is a polyhedron with six Face (geometry), faces; it has eight Vertex (geometry), vertices and twelve Edge (geometry), edges. A ''rectangular cuboid'' (sometimes also calle ...
, or in 2-D a
rectangle In Euclidean geometry, Euclidean plane geometry, a rectangle is a Rectilinear polygon, rectilinear convex polygon or a quadrilateral with four right angles. It can also be defined as: an equiangular quadrilateral, since equiangular means that a ...
, containing the object. In
dynamical simulation Dynamical simulation, in computational physics, is the simulation of systems of objects that are free to move, usually in three dimensions according to Newton's laws of classical dynamics, or approximations thereof. Dynamical simulation is us ...
, bounding boxes are preferred to other shapes of bounding volume such as
bounding sphere In mathematics, given a non-empty set of objects of finite extension in d-dimensional space, for example a set of points, a bounding sphere, enclosing sphere or enclosing ball for that set is a d-dimensional solid sphere containing all of these ...
s or
cylinders A cylinder () has traditionally been a three-dimensional solid, one of the most basic of curvilinear geometric shapes. In elementary geometry, it is considered a prism with a circle as its base. A cylinder may also be defined as an infinite ...
for objects that are roughly cuboid in shape when the intersection test needs to be fairly accurate. The benefit is obvious, for example, for objects that rest upon other, such as a car resting on the ground: a bounding sphere would show the car as possibly intersecting with the ground, which then would need to be rejected by a more expensive test of the actual model of the car; a bounding box immediately shows the car as not intersecting with the ground, saving the more expensive test. A ''
minimum bounding rectangle In computational geometry, the minimum bounding rectangle (MBR), also known as bounding box (BBOX) or envelope, is an expression of the maximum extents of a two-dimensional object (e.g. point, line, polygon) or set of objects within its coord ...
'' (''MBR'') – the least AABB in 2-D – is frequently used in the description of geographic (or "geospatial") data items, serving as a simplified proxy for a dataset's spatial extent (see
geospatial metadata Geospatial metadata (also geographic metadata) is a type of metadata applicable to geographic data and information. Such objects may be stored in a geographic information system (GIS) or may simply be documents, data-sets, images or other objects, ...
) for the purpose of data search (including spatial queries as applicable) and display. It is also a basic component of the
R-tree R-trees are tree data structures used for spatial access methods, i.e., for indexing multi-dimensional information such as geographical coordinates, rectangles or polygons. The R-tree was proposed by Antonin Guttman in 1984 and has found s ...
method of
spatial index A spatial database is a general-purpose database (usually a relational database) that has been enhanced to include spatial data that represents objects defined in a geometric space, along with tools for querying and analyzing such data. Most ...
ing. In many applications the bounding box is aligned with the axes of the co-ordinate system, and it is then known as an axis-aligned bounding box (). To distinguish the general case from an AABB, an arbitrary bounding box is sometimes called an oriented bounding box (), or an when an existing object's
local coordinate system In mathematics, particularly topology, an atlas is a concept used to describe a manifold. An atlas consists of individual ''charts'' that, roughly speaking, describe individual regions of the manifold. In general, the notion of atlas underlies th ...
is used. AABBs are much simpler to test for intersection than OBBs, but have the disadvantage that when the model is rotated they cannot be simply rotated with it, but need to be recomputed. A is a swept sphere (i.e. the volume that a sphere takes as it moves along a straight line segment) containing the object. Capsules can be represented by the radius of the swept sphere and the segment that the sphere is swept across). It has traits similar to a cylinder, but is easier to use, because the intersection test is simpler. A capsule and another object intersect if the distance between the capsule's defining segment and some feature of the other object is smaller than the capsule's radius. For example, two capsules intersect if the distance between the capsules' segments is smaller than the sum of their radii. This holds for arbitrarily rotated capsules, which is why they're more appealing than cylinders in practice. A is a
cylinder A cylinder () has traditionally been a three-dimensional solid, one of the most basic of curvilinear geometric shapes. In elementary geometry, it is considered a prism with a circle as its base. A cylinder may also be defined as an infinite ...
containing the object. In most applications the axis of the cylinder is aligned with the vertical direction of the scene. Cylinders are appropriate for 3-D objects that can only rotate about a vertical axis but not about other axes, and are otherwise constrained to move by translation only. Two vertical-axis-aligned cylinders intersect when, simultaneously, their projections on the vertical axis intersect – which are two line segments – as well their projections on the horizontal plane – two circular disks. Both are easy to test. In
video game A video game or computer game is an electronic game that involves interaction with a user interface or input device (such as a joystick, game controller, controller, computer keyboard, keyboard, or motion sensing device) to generate visual fe ...
s, bounding cylinders are often used as bounding volumes for people standing upright. A is an
ellipsoid An ellipsoid is a surface that can be obtained from a sphere by deforming it by means of directional Scaling (geometry), scalings, or more generally, of an affine transformation. An ellipsoid is a quadric surface;  that is, a Surface (mathemat ...
containing the object. Ellipsoids usually provide tighter fitting than a sphere. Intersections with ellipsoids are done by scaling the other object along the principal axes of the ellipsoid by an amount equal to the
multiplicative inverse In mathematics, a multiplicative inverse or reciprocal for a number ''x'', denoted by 1/''x'' or ''x''−1, is a number which when Multiplication, multiplied by ''x'' yields the multiplicative identity, 1. The multiplicative inverse of a ra ...
of the radii of the ellipsoid, thus reducing the problem to intersecting the scaled object with a
unit sphere In mathematics, a unit sphere is a sphere of unit radius: the locus (mathematics), set of points at Euclidean distance 1 from some center (geometry), center point in three-dimensional space. More generally, the ''unit -sphere'' is an n-sphere, -s ...
. Care should be taken to avoid problems if the applied scaling introduces skew. Skew can make the usage of ellipsoids impractical in certain cases, for example collision between two arbitrary ellipsoids. A ''
bounding sphere In mathematics, given a non-empty set of objects of finite extension in d-dimensional space, for example a set of points, a bounding sphere, enclosing sphere or enclosing ball for that set is a d-dimensional solid sphere containing all of these ...
'' is a
sphere A sphere (from Ancient Greek, Greek , ) is a surface (mathematics), surface analogous to the circle, a curve. In solid geometry, a sphere is the Locus (mathematics), set of points that are all at the same distance from a given point in three ...
containing the object. In 2-D graphics, this is a
circle A circle is a shape consisting of all point (geometry), points in a plane (mathematics), plane that are at a given distance from a given point, the Centre (geometry), centre. The distance between any point of the circle and the centre is cal ...
. Bounding spheres are represented by centre and radius. They are very quick to test for collision with each other: two spheres intersect when the distance between their centres does not exceed the sum of their radii. This makes bounding spheres appropriate for objects that can move in any number of dimensions. A is the volume that projects to an extent on an axis, and can be thought of as the
slab Slab or SLAB may refer to: Physical materials * Concrete slab, a flat concrete plate used in construction * Stone slab, a flat stone used in construction * Slab (casting), a length of metal * Slab (geology), that portion of a tectonic plate that ...
bounded between two planes. A bounding box is the intersection of orthogonally oriented bounding slabs. Bounding slabs have been used to speed up ray tracing A in 2-D is quite useful to speedup the clipping or visibility test of a B-Spline curve. See "Circle and B-Splines clipping algorithms" under the subject Clipping (computer graphics) for an example of use. A
convex hull In geometry, the convex hull, convex envelope or convex closure of a shape is the smallest convex set that contains it. The convex hull may be defined either as the intersection of all convex sets containing a given subset of a Euclidean space, ...
is the smallest convex volume containing the object. If the object is the union of a finite set of points, its convex hull is a polytope. A (DOP) generalizes the bounding box. A k-DOP is the Boolean intersection of extents along ''k'' directions. Thus, a ''k''-DOP is the Boolean intersection of ''k'' bounding slabs and is a convex
polytope In elementary geometry, a polytope is a geometric object with flat sides ('' faces''). Polytopes are the generalization of three-dimensional polyhedra to any number of dimensions. Polytopes may exist in any general number of dimensions as an ...
containing the object (in 2-D a
polygon In geometry, a polygon () is a plane figure made up of line segments connected to form a closed polygonal chain. The segments of a closed polygonal chain are called its '' edges'' or ''sides''. The points where two edges meet are the polygon ...
; in 3-D a
polyhedron In geometry, a polyhedron (: polyhedra or polyhedrons; ) is a three-dimensional figure with flat polygonal Face (geometry), faces, straight Edge (geometry), edges and sharp corners or Vertex (geometry), vertices. The term "polyhedron" may refer ...
). A 2-D rectangle is a special case of a 2-DOP, and a 3-D box is a special case of a 3-DOP. In general, the axes of a DOP do not have to be orthogonal, and there can be more axes than dimensions of space. For example, a 3-D box that is beveled on all edges and corners can be constructed as a 13-DOP. The actual number of faces can be less than 2 times ''k'' if some faces become degenerate, shrunk to an edge or a vertex.


Basic intersection checks

For some types of bounding volume (OBB and convex polyhedra), an effective check is that of the
separating axis theorem In geometry, the hyperplane separation theorem is a theorem about disjoint convex sets in ''n''-dimensional Euclidean space. There are several rather similar versions. In one version of the theorem, if both these sets are closed and at least on ...
. The idea here is that, if there exists an axis by which the objects do not overlap, then the objects do not intersect. Usually the axes checked are those of the basic axes for the volumes (the unit axes in the case of an AABB, or the 3 base axes from each OBB in the case of OBBs). Often, this is followed by also checking the cross-products of the previous axes (one axis from each object). In the case of an AABB, this tests becomes a simple set of overlap tests in terms of the unit axes. For an ''AABB'' defined by ''M'',''N'' against one defined by ''O'',''P'' they do not intersect if (''M''''x'' > ''P''''x'') or (''O''''x'' > ''N''''x'') or (''M''''y'' > ''P''''y'') or (''O''''y'' > ''N''''y'') or (''M''''z'' > ''P''''z'') or (''O''''z'' > ''N''''z''). An AABB can also be projected along an axis, for example, if it has edges of length L and is centered at ''C'', and is being projected along the axis N:
r = 0.5L_x, N_x, +0.5L_y, N_y, +0.5L_z, N_z, \,, and b=C*N\, or b=C_x N_x +C_y N_y+C_z N_z\,, and m=b-r, n=b+r\, where m and n are the minimum and maximum extents. An OBB is similar in this respect, but is slightly more complicated. For an OBB with L and C as above, and with ''I'', ''J'', and ''K'' as the OBB's base axes, then: : r = 0.5L_x, N*I, +0.5L_y, N*J, +0.5L_z, N*K, \, : m=C*N-r \mbox n=C*N+r\, For the ranges ''m'',''n'' and ''o'',''p'' it can be said that they do not intersect if ''m'' > ''p'' or ''o'' > ''n''. Thus, by projecting the ranges of 2 OBBs along the I, J, and K axes of each OBB, and checking for non-intersection, it is possible to detect non-intersection. By additionally checking along the cross products of these axes (I0×I1, I0×J1, ...) one can be more certain that intersection is impossible. This concept of determining non-intersection via use of axis projection also extends to convex polyhedra, however with the normals of each polyhedral face being used instead of the base axes, and with the extents being based on the minimum and maximum
dot product In mathematics, the dot product or scalar productThe term ''scalar product'' means literally "product with a Scalar (mathematics), scalar as a result". It is also used for other symmetric bilinear forms, for example in a pseudo-Euclidean space. N ...
s of each vertex against the axes. Note that this description assumes the checks are being done in world space. The intersection of two ''k''-DOP's can be computed very similarly to AABBs: for each orientation, you just check the two corresponding intervals of the two DOP's. So, just like DOP's being a generalization of AABBs, the intersection test is a generalization of the AABB overlap test. The complexity of the overlap test of two DOP's is in . This assumes, however, that both DOP's are given with respect to the same set of orientations. If one of them is rotated, this is no longer true. In that case, one relatively easy way to check the two DOP's D^1, D^2 for intersection is to enclose the rotated one, D^2, by another, smallest enclosing DOP \tilde^2 that is oriented with respect to the orientations of the first DOP D^1. The procedure for that is a little bit more complex, but eventually amounts to a matrix vector multiplication of complexity as well.G. Zachmann: Rapid Collision Detection by Dynamically Aligned DOP-Trees. Proc. of IEEE Virtual Reality Annual International Symposium (VRAIS, now IEEE VR), 1998, pp. 90-97, DOI 10.1109/VRAIS.1998.658428, URL: http://cgvr.informatik.uni-bremen.de/papers/vrais98/vrais98.pdf


See also

*
Convex hull algorithms Algorithms that construct convex hulls of various objects have a Convex hull#Applications, broad range of applications in mathematics and computer science. In computational geometry, numerous algorithms are proposed for computing the convex hull o ...
*
Spatial index A spatial database is a general-purpose database (usually a relational database) that has been enhanced to include spatial data that represents objects defined in a geometric space, along with tools for querying and analyzing such data. Most ...
*
Hitbox Collision detection is the computational problem of detecting an intersection of two or more objects in virtual space. More precisely, it deals with the questions of ''if'', ''when'' and ''where'' two or more objects intersect. Collision detect ...


References

{{reflist


External links


Illustration of several DOPs for the same model, from epicgames.com
Geometric algorithms 3D computer graphics