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 ZWe compute of cube around the object:
- We compute the center of the object:
(min+max)/2
in X, Y and Z
- We prepare a cube of size 1 (1x1x1), centered on the origin
- We scale it by the size of the object
To draw the cube:
- We center it on the object
- 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