Content deleted Content added
←Created page with '{{Short description|Ray-box intersection method}} In computer graphics, the '''slab method''' is an algorithm used to solve the ray-box intersection problem in case of an axis-aligned bounding box (AABB), i.e. to determine the intersection points between a ray and the box. Due to its efficient nature, that can allow for a branch-free implementation, it is widely used in com...' |
m →Sources: clean up, replaced: |journal=Journal of Computer Graphics Techniques (JCGT) → |journal=Journal of Computer Graphics Techniques |
||
(8 intermediate revisions by 7 users not shown) | |||
Line 1:
{{Short description|Ray-box intersection method}}
In [[computer graphics]], the '''slab method''' is an [[algorithm]] used to solve the ray-box intersection problem in case of an [[Axis-aligned object|axis-aligned]] [[bounding box]] (AABB), i.e. to determine the intersection points between a [[ray (geometry)|ray]] and the box. Due to its efficient nature, that can allow for a [[branch (computer science)|branch]]-free implementation, it is widely used in computer graphics applications.{{sfn|Shirley|Wald|Marrs|2021}}{{sfn|Majercik|Crassin|Shirley|
== Algorithm ==
Line 10:
:<math>\boldsymbol p(t) = \boldsymbol o + t \boldsymbol r</math>.
Assuming that all intersections
:<math>t = \frac{\boldsymbol p - \boldsymbol o}{\boldsymbol r}</math>
Line 50:
</math>
While the equations above are well defined for [[real number|real-valued]] variables only if <math>r_i \ne 0 \; \forall i</math>, i.e. if the ray is not parallel to any of the coordinate axes, the algorithm can be applied to an [[Extended real number line|extended real number]] arithmetic (such as the one implemented by [[IEEE 754]]) to handle rays parallel to an axis, as long as the origin of the ray itself does not lie on one of the faces of the bounding box. In such arithmetic, the intersections with the planes parallel to the ray will be given by <math>t = +\infty</math> or <math>t = -\infty</math>, and the algorithm will still work as expected. If the origin lies on a face of the bounding box, then for some <math>i</math> it will happen that <math>t_i = \frac{0}{0}</math>, which is undefined (in IEEE 754 it is represented by [[NaN]]). However, implementations of the [[IEEE 754-2008 revision|IEEE 754-2008]]
== References ==
Line 56:
== Sources ==
* {{cite book|
* {{cite conference|last1=Kay|first1=Timothy L.|last2=Kajiya|first2=James T.|title=Ray tracing complex scenes|conference=ACM SIGGRAPH computer graphics|volume=20|number=4
* {{cite journal|first1=Alexander|last1=Majercik|first2=Cyril|last2=Crassin|first3=Peter|last3=Shirley|first4=Morgan|last4=McGuire|title=A Ray-Box Intersection Algorithm and Efficient Dynamic Voxel Rendering|journal=Journal of Computer Graphics Techniques
* {{cite book|title=Ray Tracing Gems II|chapter=Ray Axis-Aligned Bounding Box Intersection|first1=Peter|last1=Shirley|first2=Ingo|last2=Wald|first3=Adam|last3=Marrs|publisher=Apress|___location=Berkeley, CA|year=2021}}
== External links ==
* {{cite web|last=Barnes|first=
{{DEFAULTSORT:Slab method}}
|