All Topics  
Bounding volume

 
Bounding Volume

   Email Print
   Bookmark   Link






 

Bounding volume



 
 
For building code
Building code

A building code, or building control, is a set of rules that specify the minimum acceptable level of safety for constructed objects such as buildings and nonbuilding structures....
 compliance, see Bounding
Bounding

Listing and approval use and compliance is the activity of adhering to all the requirements of installing and/or using safety-related products and items in conformance with an active certification listing or approval that has been issued by an organisation that is accredited both for testing and product certification, such as those is...
.


In computer graphics
Computer graphics

Computer graphics are graphics created by computers and, more generally, the representation and manipulation of pictorial data by a computer....
 and computational geometry
Computational geometry

Computational geometry is a branch of computer science devoted to the study of algorithms which can be stated in terms of geometry. Some purely geometrical problems arise out of the study of computational geometric algorithms, and such problems are also considered to be part of computational geometry....
, a bounding volume for a set of objects is a closed volume that completely contains the union of the objects in the set. Bounding volumes are used to improve the efficiency of geometrical operations by using simple volumes to contain more complex objects.






Discussion
Ask a question about 'Bounding volume'
Start a new discussion about 'Bounding volume'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Boundingbox
For building code
Building code

A building code, or building control, is a set of rules that specify the minimum acceptable level of safety for constructed objects such as buildings and nonbuilding structures....
 compliance, see Bounding
Bounding

Listing and approval use and compliance is the activity of adhering to all the requirements of installing and/or using safety-related products and items in conformance with an active certification listing or approval that has been issued by an organisation that is accredited both for testing and product certification, such as those is...
.


In computer graphics
Computer graphics

Computer graphics are graphics created by computers and, more generally, the representation and manipulation of pictorial data by a computer....
 and computational geometry
Computational geometry

Computational geometry is a branch of computer science devoted to the study of algorithms which can be stated in terms of geometry. Some purely geometrical problems arise out of the study of computational geometric algorithms, and such problems are also considered to be part of computational geometry....
, a bounding volume for a set of objects is a closed volume that completely contains the union of the objects in the set. Bounding volumes are used to improve the efficiency of geometrical operations by using simple volumes to contain more complex objects. Normally, simpler volumes have simpler ways to test for overlap.

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 of bounding volumes

Bounding volumes are most often used to accelerate certain kinds of tests.

In ray tracing
Ray tracing

In computer graphics, ray tracing is a technique for generating an digital image by tracing the path of light through pixel in an . The technique is capable of producing a very high degree of photorealism; usually higher than that of typical scanline rendering methods, but at a greater computation time....
, bounding volumes are used in ray-intersection tests, and in many rendering
Rendering (computer graphics)

Rendering is the process of generating an image from a 3D model, by means of computer programs. The model is a description of three-dimensional objects in a strictly defined language or data structure....
 algorithms, they are used for viewing frustum
Viewing frustum

In 3D computer graphics, the 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 the notional camera....
 tests. If the ray or viewing frustum does not intersect the bounding volume, it cannot intersect the object contained in the volume. These intersection tests produce a list of objects that must be displayed. Here, displayed means rendered or rasterized.

In collision detection
Collision detection

In physical simulations, video games and computational geometry, collision detection involves algorithms for checking for collision, i.e. intersection, of two given solids....
, when two bounding volumes do not intersect, then the contained objects cannot collide, either.

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
Scene graph

A scene graph is a general data structure commonly used by vector graphics applications and modern computer games. Examples of such programs include AutoCAD, Adobe Illustrator, Acrobat 3D, OpenSceneGraph and CorelDRAW....
 or more specifically bounding volume hierarchies 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.

Common types of bounding volume


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 intesection test. 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 set

In Euclidean space, an object is convex if for every pair of points within the object, every point on the straight line segment that joins them is also within the object....
 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 sphere
Bounding sphere

In mathematics, given a non-empty set of objects of finite extension in n-dimensional space, for example a set of points, a bounding sphere, enclosing sphere or enclosing ball for that set is an n-dimensional solid sphere containing all of these objects....
 is a sphere
Sphere

A sphere is a symmetrical geometrical object. In non-mathematical usage, the term is used to refer either to a round ball or to its two-dimensional surface....
 containing the object. In 2-D graphics, this is a circle
Circle

A circle is a simple shape of Euclidean geometry consisting of those point in a plane which are the same distance from a given point called the center....
. 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 bounding ellipsoid is an ellipsoid
Ellipsoid

An ellipsoid is a type of Quadric that is a higher dimensional analogue of an ellipse. The equation of a standard axis-aligned ellipsoid body in an xyz-Cartesian coordinate system is...
 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
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 multiplied by x yields the multiplicative identity, 1....
 of the radii of the ellipsoid, thus reducing the problem to intersecting the scaled object with a unit sphere. Care should be taken to avoid problems if the applied scaling introduces skew
Skew

Skew or skew lines lie on different planes. They are neither parallel nor intersecting....
. Skew can make the usage of ellipsoids impractical in certain cases, for example collision between two arbitrary ellipsoids.

A bounding cylinder is a cylinder
Cylinder (geometry)

A cylinder is one of the most curvilinear basic geometric shapes: the surface formed by the points at a fixed distance from a given straight line, the axis of the cylinder....
 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 games, bounding cylinders are often used as bounding volumes for people standing upright.

A bounding capsule 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 bounding box is a cuboid
Cuboid

In geometry, a cuboid is a solid figure bounded by six faces, forming a convex polyhedron. There are two competing and incompatible definitions of a cuboid in the mathematical literature....
, or in 2-D a rectangle
Rectangle

In geometry, a rectangle is a Closed set planar quadrilateral with four right angles. A rectangle with vertices ABCD would be denoted as .A rectangle with adjacent sides of lengths a and b has area ab and diagonals of equal length ....
, containing the object. In dynamical simulation
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 dynamics, or approximations thereto....
, bounding boxes are preferred to other shapes of bounding volume such as bounding sphere
Bounding sphere

In mathematics, given a non-empty set of objects of finite extension in n-dimensional space, for example a set of points, a bounding sphere, enclosing sphere or enclosing ball for that set is an n-dimensional solid sphere containing all of these objects....
s or cylinders 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.

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 (AABB). To distinguish the general case from an AABB, an arbitrary bounding box is sometimes called an oriented bounding box (OBB). 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 minimum bounding rectangle
Minimum bounding rectangle

The minimum bounding rectangle , also known as bounding box or envelope, is an expression of the maximum extents of a 2-dimensional object within its 2-D coordinate system, in other words min, max, min, max....
 or 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

Geospatial metadata is a type of metadata that is applicable to objects that have an explicit or implicit Geography extent, in other words, are associated with some position on the surface of the Globe....
) for the purpose of data search (including spatial queries as applicable) and display. It is also a basic component of the R-tree
R-tree

R-trees are tree data structures that are similar to B-trees, but are used for spatial indexs i.e., for indexing multi-dimensional information; for example, the coordinates of geographical data....
 method of spatial index
Spatial index

Spatial indexes are used by spatial databases to optimize spatial query. Indexes used by non-spatial databases cannot effectively handle features such as how far two points differ and whether points fall within a spatial area of interest....
ing.

A discrete oriented polytope (DOP) generalizes the AABB. A DOP is a convex polytope
Polytope

In geometry, polytope is a generic term that can refer to a two-dimensional polygon, a three-dimensional polyhedron, or any of the various generalizations thereof, including generalizations to higher dimensions and other abstractions ....
 containing the object (in 2-D a polygon
Polygon

In geometry a polygon is traditionally a plane Shape that is bounded by a closed curve path or circuit, composed of a finite sequence of straight line segments ....
; in 3-D a polyhedron
Polyhedron

|}A polyhedron is often defined as a geometry object with flat faces and straight edges .This definition of a polyhedron is not very precise, and to a modern mathematician is quite unsatisfactory....
), constructed by taking a number of suitably oriented planes at infinity and moving them until they collide with the object. The DOP is then the convex polytope resulting from intersection of the half-spaces bounded by the planes. Popular choices for constructing DOPs in 3-D graphics include the axis-aligned bounding box, made from 6 axis-aligned planes, and the beveled bounding box, made from 10 (if beveled only on vertical edges, say) 18 (if beveled on all edges), or 26 planes (if beveled on all edges and corners). A DOP constructed from k planes is called a k-DOP; the actual number of faces can be less than k, since some can become degenerate, shrunk to an edge or a vertex.

A convex hull
Convex hull

In mathematics, the convex hull or convex envelope for a Set of points X in a real vector space V is the minimal convex set containing X....
 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, and in fact the smallest possible containing polytope.

Basic intersection checks

For some types of bounding volume (OBB and convex polyhedra), an effective check is that of the separating axis theorem
Separating axis theorem

For objects lying in a plane , the separating axis theorem states that, given two convex set shapes, there exists a line onto which their projections will be separate if and only if they are not intersecting....
. 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 (Mx>Px) or (Ox>Nx) or (My>Py) or (Oy>Ny) or (Mz>Pz) or (Oz>Nz).

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:
, and or , and 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:


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 products of each vertex against the axes. Note that this description assumes the checks are being done in world space.

See also

  • Minimum bounding rectangle
    Minimum bounding rectangle

    The minimum bounding rectangle , also known as bounding box or envelope, is an expression of the maximum extents of a 2-dimensional object within its 2-D coordinate system, in other words min, max, min, max....
  • Spatial index
    Spatial index

    Spatial indexes are used by spatial databases to optimize spatial query. Indexes used by non-spatial databases cannot effectively handle features such as how far two points differ and whether points fall within a spatial area of interest....
  • Minimum bounding box
    Minimum bounding box

    The minimum or smallest bounding or enclosing box for a point set in N dimensions is the box with the smallest measure which all the points lie within....


External links