|
|
(444 intermediate revisions by more than 100 users not shown) |
Line 1: |
Line 1: |
| [[Image:BoundingBox.jpg|thumb|A three-dimensional model with its bounding box drawn in dashed lines.]]
| | This is a preview for the new '''MathML rendering mode''' (with SVG fallback), which is availble in production for registered users. |
|
| |
|
| :''For [[building code]] compliance, see [[Bounding]].''
| | If you would like use the '''MathML''' rendering mode, you need a wikipedia user account that can be registered here [[https://en.wikipedia.org/wiki/Special:UserLogin/signup]] |
| | * Only registered users will be able to execute this rendering mode. |
| | * Note: you need not enter a email address (nor any other private information). Please do not use a password that you use elsewhere. |
|
| |
|
| In [[computer graphics]] and [[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.
| | Registered users will be able to choose between the following three rendering modes: |
|
| |
|
| 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).
| | '''MathML''' |
| | :<math forcemathmode="mathml">E=mc^2</math> |
|
| |
|
| ==Uses of bounding volumes== | | <!--'''PNG''' (currently default in production) |
| Bounding volumes are most often used to accelerate certain kinds of tests.
| | :<math forcemathmode="png">E=mc^2</math> |
|
| |
|
| In [[Ray tracing (graphics)|ray tracing]], bounding volumes are used in ray-intersection tests, and in many [[rendering (computer graphics)|rendering]] [[algorithms]], they are used for [[viewing frustum]] 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.
| | '''source''' |
| | :<math forcemathmode="source">E=mc^2</math> --> |
|
| |
|
| In [[collision detection]], when two bounding volumes do not intersect, then the contained objects cannot collide, either.
| | <span style="color: red">Follow this [https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering link] to change your Math rendering settings.</span> You can also add a [https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering-skin Custom CSS] to force the MathML/SVG rendering or select different font families. See [https://www.mediawiki.org/wiki/Extension:Math#CSS_for_the_MathML_with_SVG_fallback_mode these examples]. |
|
| |
|
| 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.)
| | ==Demos== |
|
| |
|
| To obtain bounding volumes of complex objects, a common way is to break the objects/scene down using a [[scene graph]] or more specifically [[bounding volume hierarchy|bounding volume hierarchies]] like e.g. [[OBB tree]]s. 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.
| | Here are some [https://commons.wikimedia.org/w/index.php?title=Special:ListFiles/Frederic.wang demos]: |
|
| |
|
| ==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 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.
| | * accessibility: |
| | ** Safari + VoiceOver: [https://commons.wikimedia.org/wiki/File:VoiceOver-Mac-Safari.ogv video only], [[File:Voiceover-mathml-example-1.wav|thumb|Voiceover-mathml-example-1]], [[File:Voiceover-mathml-example-2.wav|thumb|Voiceover-mathml-example-2]], [[File:Voiceover-mathml-example-3.wav|thumb|Voiceover-mathml-example-3]], [[File:Voiceover-mathml-example-4.wav|thumb|Voiceover-mathml-example-4]], [[File:Voiceover-mathml-example-5.wav|thumb|Voiceover-mathml-example-5]], [[File:Voiceover-mathml-example-6.wav|thumb|Voiceover-mathml-example-6]], [[File:Voiceover-mathml-example-7.wav|thumb|Voiceover-mathml-example-7]] |
| | ** [https://commons.wikimedia.org/wiki/File:MathPlayer-Audio-Windows7-InternetExplorer.ogg Internet Explorer + MathPlayer (audio)] |
| | ** [https://commons.wikimedia.org/wiki/File:MathPlayer-SynchronizedHighlighting-WIndows7-InternetExplorer.png Internet Explorer + MathPlayer (synchronized highlighting)] |
| | ** [https://commons.wikimedia.org/wiki/File:MathPlayer-Braille-Windows7-InternetExplorer.png Internet Explorer + MathPlayer (braille)] |
| | ** NVDA+MathPlayer: [[File:Nvda-mathml-example-1.wav|thumb|Nvda-mathml-example-1]], [[File:Nvda-mathml-example-2.wav|thumb|Nvda-mathml-example-2]], [[File:Nvda-mathml-example-3.wav|thumb|Nvda-mathml-example-3]], [[File:Nvda-mathml-example-4.wav|thumb|Nvda-mathml-example-4]], [[File:Nvda-mathml-example-5.wav|thumb|Nvda-mathml-example-5]], [[File:Nvda-mathml-example-6.wav|thumb|Nvda-mathml-example-6]], [[File:Nvda-mathml-example-7.wav|thumb|Nvda-mathml-example-7]]. |
| | ** Orca: There is ongoing work, but no support at all at the moment [[File:Orca-mathml-example-1.wav|thumb|Orca-mathml-example-1]], [[File:Orca-mathml-example-2.wav|thumb|Orca-mathml-example-2]], [[File:Orca-mathml-example-3.wav|thumb|Orca-mathml-example-3]], [[File:Orca-mathml-example-4.wav|thumb|Orca-mathml-example-4]], [[File:Orca-mathml-example-5.wav|thumb|Orca-mathml-example-5]], [[File:Orca-mathml-example-6.wav|thumb|Orca-mathml-example-6]], [[File:Orca-mathml-example-7.wav|thumb|Orca-mathml-example-7]]. |
| | ** From our testing, ChromeVox and JAWS are not able to read the formulas generated by the MathML mode. |
|
| |
|
| The types treated here all give [[convex set|convex]] 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.
| | ==Test pages == |
|
| |
|
| A '''bounding box''' is a [[cuboid]], or in 2-D a [[rectangle]], containing the object. In [[dynamical simulation]], bounding boxes are preferred to other shapes of bounding volume such as [[bounding sphere]]s or [[bounding cylinder|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.
| | To test the '''MathML''', '''PNG''', and '''source''' rendering modes, please go to one of the following test pages: |
| | *[[Displaystyle]] |
| | *[[MathAxisAlignment]] |
| | *[[Styling]] |
| | *[[Linebreaking]] |
| | *[[Unique Ids]] |
| | *[[Help:Formula]] |
|
| |
|
| 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.
| | *[[Inputtypes|Inputtypes (private Wikis only)]] |
| | | *[[Url2Image|Url2Image (private Wikis only)]] |
| A '''bounding cylinder''' is a [[cylinder (geometry)|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 game]]s, bounding cylinders are often used as bounding volumes for people standing upright.
| | ==Bug reporting== |
| | | If you find any bugs, please report them at [https://bugzilla.wikimedia.org/enter_bug.cgi?product=MediaWiki%20extensions&component=Math&version=master&short_desc=Math-preview%20rendering%20problem Bugzilla], or write an email to math_bugs (at) ckurs (dot) de . |
| A '''bounding ellipsoid''' is an [[ellipsoid]] containing the object. Ellipsoids usually provide tighter fitting than a sphere. Intersections with ellipsoids are done by scaling the other object along the [[Principal axis theorem|principal axes]] of the ellipsoid by an amount equal to the [[multiplicative inverse]] 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 can make the usage of ellipsoids impractical in certain cases, for example collision between two arbitrary ellipsoids.
| |
| | |
| A '''bounding slab''' is related to the AABB and used to speed up [[ray tracing (graphics)|ray tracing]]<ref>
| |
| [[POV-Ray]] Documentation[http://www.povray.org/documentation/view/3.6.1/323/] | |
| </ref>
| |
| | |
| A '''[[bounding sphere]]''' is a [[sphere]] containing the object. In 2-D graphics, this is a [[circle]]. 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.
| |
| | |
| 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 '''bounding triangle''' in 2-D is quite useful to speedup the clipping or visibility test of a B-Spline curve. See [[Clipping (computer graphics)#Algorithms|"Circle and B-Splines clipping algorithms"]] under the subject Clipping (computer graphics) for an example of use.
| |
| | |
| A '''[[convex hull]]''' 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 '''discrete oriented polytope''' ('''DOP''') generalizes the AABB. A DOP is a convex [[polytope]] containing the object (in 2-D a [[polygon]]; in 3-D a [[polyhedron]]), 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 '''[[minimum bounding rectangle]]''' 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]]) for the purpose of data search (including spatial queries as applicable) and display. It is also a basic component of the [[R-tree]] method of [[spatial index]]ing.
| |
| | |
| ==Basic intersection checks== | |
| For some types of bounding volume (OBB and convex polyhedra), an effective check is that of the [[separating axis theorem]]. 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<!-- plural of axis is axes, per Webster--> 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<sub>x</sub>>P<sub>x</sub>) or (O<sub>x</sub>>N<sub>x</sub>) or (M<sub>y</sub>>P<sub>y</sub>) or (O<sub>y</sub>>N<sub>y</sub>) or (M<sub>z</sub>>P<sub>z</sub>) or (O<sub>z</sub>>N<sub>z</sub>).
| |
| | |
| 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:<br/>
| |
| <math>r = 0.5L_x|N_x|+0.5L_y|N_y|+0.5L_z|N_z|\,</math>, and <math>b=C*N\,</math> or <math>b=C_x N_x +C_y N_y+C_z N_z\,</math>, and <math>m=b-r, n=b+r\,</math>
| |
| 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:<br/>
| |
| <math>r = 0.5L_x|N*I|+0.5L_y|N*J|+0.5L_z|N*K|\,</math>
| |
| | |
| <math>m=C*N-r \mbox{ and } n=C*N+r\,</math>
| |
| | |
| 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 (I<sub>0</sub>×I<sub>1</sub>, I<sub>0</sub>×J<sub>1</sub>, ...) 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==
| |
| * [[Bounding sphere]]
| |
| * [[Convex hull algorithms]]
| |
| * [[Minimum bounding box]]
| |
| * [[Minimum bounding rectangle]]
| |
| * [[Spatial index]]
| |
| | |
| ==References==
| |
| {{reflist}}
| |
| | |
| ==External links==
| |
| *[http://udn.epicgames.com/Two/rsrc/Two/CollisionTutorial/kdop_sizes.jpg Illustration of several DOPs for the same model, from epicgames.com]
| |
| | |
| [[Category:Geometric algorithms]]
| |
| [[Category:3D computer graphics]]
| |