Wednesday, June 1, 2016

Bounding.Box

Bounding Box

Cited Official
https://en.wikibooks.org/wiki/OpenGL_Programming/Bounding_box

**

OpenGL Programming/Bounding box
Conception

We analyze the object:
  • Minimum coordinates in X, Y and Z
  • Maximum coordinates in X, Y and Z
  • We compute the size necessary for the object: max-min in X, Y and Z
  • We compute the center of the object: (min+max)/2 in X, Y and Z
We compute of cube around the object:
  • We prepare a cube of size 1 (1x1x1), centered on the origin
  • We scale it by the size of the object
  • We center it on the object
To draw the cube:
  • We draw the front face using 1 looping line
  • We draw the back face using 1 looping line
  • We draw 4 orthogonal lines to join both faces



....
[]

...
[]

No comments:

Post a Comment