SlideShare a Scribd company logo
1 of 8
Closest Point on OBB to Point By: J3J3BU5T3R5
Let B be an Object Bounding Box(OBB) given by a center point C; three orthogonal unit vectors u0, u1, and u2(V1,V2,V3) and three scalar values e0, e1, and e2 (x , y and z) specifying the box half widths along each axis A point P in world space relates to its corresponding point Q = (x, y, z) in the coordinate system of the OBB B as P = C + xu0 + yu1 + zu2.
Given P, the OBB-space coordinates can be solved for as follows. Only the derivation of the x coordinate is shown here. The other coordinates can be solved for in a similar manner.
P = C + xu0 + yu1 + zu2 ⇔ (original expression) P − C = xu0 + yu1 + zu2 ⇔ (moving C to left side) (P − C) · u0 = (xu0 + yu1 + zu2) · u0 ⇔ (taking dot product with u0 on both sides) (P − C) · u0 = x(u0 · u0) + y(u1 · u0) + z(u2 · u0) ⇔ (expanding dot product expression) (P − C) · u0 = x (simplifying using u0 · u0 = 1, u1 · u0 = u2 · u0 = 0)
The full set of OBB coordinates are thus given by x = (P −C) · u0, y = (P −C) · u1, and z = (P − C) · u2. To compute the point R on (or in) B closest to P, the same approach as used for an AABB can be applied by expressing P in the OBB coordinate system as Q, clamping Q to the extents e0, e1, and e2, and reexpressing Q in world coordinates.
Closest Point on Convex Polyhedron to Point Several approaches are available for locating the point on a convex polyhedron H closest to a point P in space. A simple-to-implement O(n) method is to compute the point on each polyhedron face closest to P and return the one closest to P. A concurrently run test determines if P lies inside all faces of H, in which case P is interior to H. To speed up the test, the face distance calculation would have to be run only when P lies in front of the face.
For larger polyhedra, a faster approach is to construct, as a precomputation, a hierarchy over the parts of the polyhedron. Utilizing a preconstructed hierarchy allows the closest point to be located in logarithmic time. An example of such a hierarchy is the Dobkin–Kirkpatrick hierarchy, described in Chapter 9. Chapter 9 also describes other approaches that can efficiently locate the closest point on the polyhedra (such as the GJK algorithm).
Sources: Real-time collision- detection by Christer Ericson Code edited in c++ Visual Studio http://pastie.org/1066466

More Related Content

What's hot

Pc9-1 polar coordinates
Pc9-1 polar coordinatesPc9-1 polar coordinates
Pc9-1 polar coordinatesvhiggins1
 
Math tcwag 6, p 248, no 26 27
Math  tcwag 6, p 248, no 26 27Math  tcwag 6, p 248, no 26 27
Math tcwag 6, p 248, no 26 27potassium2012
 
CLASS X MATHS
CLASS X MATHS CLASS X MATHS
CLASS X MATHS Rc Os
 
Introduction To Polar Coordinates And Graphs
Introduction To Polar Coordinates And GraphsIntroduction To Polar Coordinates And Graphs
Introduction To Polar Coordinates And Graphseekeeney
 
10. polar coordinates x
10. polar coordinates x10. polar coordinates x
10. polar coordinates xharbormath240
 
11. polar equations and graphs x
11. polar equations and graphs x11. polar equations and graphs x
11. polar equations and graphs xharbormath240
 
Math Investigation: Pythagorean Theorem
Math Investigation: Pythagorean TheoremMath Investigation: Pythagorean Theorem
Math Investigation: Pythagorean TheoremKharelle Mae Naduma
 
Mensuration ppt
Mensuration pptMensuration ppt
Mensuration pptcooliohan
 
Presentation 2
Presentation 2Presentation 2
Presentation 2massie19
 
Surface area and volume 1
Surface area and volume   1Surface area and volume   1
Surface area and volume 1dhanuch
 
cylinderical and sperical co ordinate systems
cylinderical and sperical co ordinate systems cylinderical and sperical co ordinate systems
cylinderical and sperical co ordinate systems GK Arunachalam
 
34 polar coordinate and equations
34 polar coordinate and equations34 polar coordinate and equations
34 polar coordinate and equationsmath266
 

What's hot (19)

Mensuration
Mensuration Mensuration
Mensuration
 
Pc9-1 polar coordinates
Pc9-1 polar coordinatesPc9-1 polar coordinates
Pc9-1 polar coordinates
 
Math tcwag 6, p 248, no 26 27
Math  tcwag 6, p 248, no 26 27Math  tcwag 6, p 248, no 26 27
Math tcwag 6, p 248, no 26 27
 
zfsghf
zfsghfzfsghf
zfsghf
 
CLASS X MATHS
CLASS X MATHS CLASS X MATHS
CLASS X MATHS
 
Introduction To Polar Coordinates And Graphs
Introduction To Polar Coordinates And GraphsIntroduction To Polar Coordinates And Graphs
Introduction To Polar Coordinates And Graphs
 
10. polar coordinates x
10. polar coordinates x10. polar coordinates x
10. polar coordinates x
 
Mensuration
MensurationMensuration
Mensuration
 
07 vectors
07   vectors07   vectors
07 vectors
 
11. polar equations and graphs x
11. polar equations and graphs x11. polar equations and graphs x
11. polar equations and graphs x
 
Unicamp 2016 - aberta
Unicamp 2016 - abertaUnicamp 2016 - aberta
Unicamp 2016 - aberta
 
Fuvest 2012 - aberta
Fuvest 2012 - abertaFuvest 2012 - aberta
Fuvest 2012 - aberta
 
ITA 2013 - aberta
ITA 2013 - abertaITA 2013 - aberta
ITA 2013 - aberta
 
Math Investigation: Pythagorean Theorem
Math Investigation: Pythagorean TheoremMath Investigation: Pythagorean Theorem
Math Investigation: Pythagorean Theorem
 
Mensuration ppt
Mensuration pptMensuration ppt
Mensuration ppt
 
Presentation 2
Presentation 2Presentation 2
Presentation 2
 
Surface area and volume 1
Surface area and volume   1Surface area and volume   1
Surface area and volume 1
 
cylinderical and sperical co ordinate systems
cylinderical and sperical co ordinate systems cylinderical and sperical co ordinate systems
cylinderical and sperical co ordinate systems
 
34 polar coordinate and equations
34 polar coordinate and equations34 polar coordinate and equations
34 polar coordinate and equations
 

Similar to Closest point on OBB to point by j3j3bu5t3r5

Lecture1.8 Geometric method for solving or evaluating quadratic expressions
Lecture1.8 Geometric method for solving or evaluating quadratic expressionsLecture1.8 Geometric method for solving or evaluating quadratic expressions
Lecture1.8 Geometric method for solving or evaluating quadratic expressionsnarayana dash
 
Analytical Geometry in three dimension
Analytical Geometry in three dimensionAnalytical Geometry in three dimension
Analytical Geometry in three dimensionSwathiSundari
 
planes and distances
planes and distancesplanes and distances
planes and distancesElias Dinsa
 
Gmat quant topic 6 co ordinate geometry solutions
Gmat quant topic 6 co ordinate geometry solutionsGmat quant topic 6 co ordinate geometry solutions
Gmat quant topic 6 co ordinate geometry solutionsRushabh Vora
 
Derivation of great-circle distance formula using of HCR's Inverse cosine for...
Derivation of great-circle distance formula using of HCR's Inverse cosine for...Derivation of great-circle distance formula using of HCR's Inverse cosine for...
Derivation of great-circle distance formula using of HCR's Inverse cosine for...Harish Chandra Rajpoot
 
Lab mannual ncert 3
Lab mannual ncert 3Lab mannual ncert 3
Lab mannual ncert 3Himani Asija
 
Three dim. geometry
Three dim. geometryThree dim. geometry
Three dim. geometryindu thakur
 
Math - analytic geometry
Math - analytic geometryMath - analytic geometry
Math - analytic geometryimmortalmikhel
 
Computer Graphic - Projections
Computer Graphic - ProjectionsComputer Graphic - Projections
Computer Graphic - Projections2013901097
 
Coordinategeometry1 1
Coordinategeometry1 1Coordinategeometry1 1
Coordinategeometry1 1TGTMATH
 
Coordinategeometry1 1
Coordinategeometry1 1Coordinategeometry1 1
Coordinategeometry1 1TGTMATH
 
Chapter 12 vectors and the geometry of space merged
Chapter 12 vectors and the geometry of space mergedChapter 12 vectors and the geometry of space merged
Chapter 12 vectors and the geometry of space mergedEasyStudy3
 
Loci versi melayu
Loci versi melayuLoci versi melayu
Loci versi melayusaliza sham
 
Harmonic division
Harmonic divisionHarmonic division
Harmonic divisionArvee Mae
 

Similar to Closest point on OBB to point by j3j3bu5t3r5 (20)

Lecture1.8 Geometric method for solving or evaluating quadratic expressions
Lecture1.8 Geometric method for solving or evaluating quadratic expressionsLecture1.8 Geometric method for solving or evaluating quadratic expressions
Lecture1.8 Geometric method for solving or evaluating quadratic expressions
 
Analytical Geometry in three dimension
Analytical Geometry in three dimensionAnalytical Geometry in three dimension
Analytical Geometry in three dimension
 
planes and distances
planes and distancesplanes and distances
planes and distances
 
Coordinate geometry
Coordinate geometryCoordinate geometry
Coordinate geometry
 
Plano numerico.
Plano numerico.Plano numerico.
Plano numerico.
 
Gmat quant topic 6 co ordinate geometry solutions
Gmat quant topic 6 co ordinate geometry solutionsGmat quant topic 6 co ordinate geometry solutions
Gmat quant topic 6 co ordinate geometry solutions
 
returika
returikareturika
returika
 
Derivation of great-circle distance formula using of HCR's Inverse cosine for...
Derivation of great-circle distance formula using of HCR's Inverse cosine for...Derivation of great-circle distance formula using of HCR's Inverse cosine for...
Derivation of great-circle distance formula using of HCR's Inverse cosine for...
 
Lab mannual ncert 3
Lab mannual ncert 3Lab mannual ncert 3
Lab mannual ncert 3
 
Three dim. geometry
Three dim. geometryThree dim. geometry
Three dim. geometry
 
Lect 1_TMT 20303.pptx
Lect 1_TMT 20303.pptxLect 1_TMT 20303.pptx
Lect 1_TMT 20303.pptx
 
JC Vectors summary
JC Vectors summaryJC Vectors summary
JC Vectors summary
 
Math - analytic geometry
Math - analytic geometryMath - analytic geometry
Math - analytic geometry
 
Computer Graphic - Projections
Computer Graphic - ProjectionsComputer Graphic - Projections
Computer Graphic - Projections
 
Computer Graphics - Projections
Computer Graphics - ProjectionsComputer Graphics - Projections
Computer Graphics - Projections
 
Coordinategeometry1 1
Coordinategeometry1 1Coordinategeometry1 1
Coordinategeometry1 1
 
Coordinategeometry1 1
Coordinategeometry1 1Coordinategeometry1 1
Coordinategeometry1 1
 
Chapter 12 vectors and the geometry of space merged
Chapter 12 vectors and the geometry of space mergedChapter 12 vectors and the geometry of space merged
Chapter 12 vectors and the geometry of space merged
 
Loci versi melayu
Loci versi melayuLoci versi melayu
Loci versi melayu
 
Harmonic division
Harmonic divisionHarmonic division
Harmonic division
 

Closest point on OBB to point by j3j3bu5t3r5

  • 1. Closest Point on OBB to Point By: J3J3BU5T3R5
  • 2. Let B be an Object Bounding Box(OBB) given by a center point C; three orthogonal unit vectors u0, u1, and u2(V1,V2,V3) and three scalar values e0, e1, and e2 (x , y and z) specifying the box half widths along each axis A point P in world space relates to its corresponding point Q = (x, y, z) in the coordinate system of the OBB B as P = C + xu0 + yu1 + zu2.
  • 3. Given P, the OBB-space coordinates can be solved for as follows. Only the derivation of the x coordinate is shown here. The other coordinates can be solved for in a similar manner.
  • 4. P = C + xu0 + yu1 + zu2 ⇔ (original expression) P − C = xu0 + yu1 + zu2 ⇔ (moving C to left side) (P − C) · u0 = (xu0 + yu1 + zu2) · u0 ⇔ (taking dot product with u0 on both sides) (P − C) · u0 = x(u0 · u0) + y(u1 · u0) + z(u2 · u0) ⇔ (expanding dot product expression) (P − C) · u0 = x (simplifying using u0 · u0 = 1, u1 · u0 = u2 · u0 = 0)
  • 5. The full set of OBB coordinates are thus given by x = (P −C) · u0, y = (P −C) · u1, and z = (P − C) · u2. To compute the point R on (or in) B closest to P, the same approach as used for an AABB can be applied by expressing P in the OBB coordinate system as Q, clamping Q to the extents e0, e1, and e2, and reexpressing Q in world coordinates.
  • 6. Closest Point on Convex Polyhedron to Point Several approaches are available for locating the point on a convex polyhedron H closest to a point P in space. A simple-to-implement O(n) method is to compute the point on each polyhedron face closest to P and return the one closest to P. A concurrently run test determines if P lies inside all faces of H, in which case P is interior to H. To speed up the test, the face distance calculation would have to be run only when P lies in front of the face.
  • 7. For larger polyhedra, a faster approach is to construct, as a precomputation, a hierarchy over the parts of the polyhedron. Utilizing a preconstructed hierarchy allows the closest point to be located in logarithmic time. An example of such a hierarchy is the Dobkin–Kirkpatrick hierarchy, described in Chapter 9. Chapter 9 also describes other approaches that can efficiently locate the closest point on the polyhedra (such as the GJK algorithm).
  • 8. Sources: Real-time collision- detection by Christer Ericson Code edited in c++ Visual Studio http://pastie.org/1066466