Skip to Main Content
3D Game Engine Design, 2nd Edition
book

3D Game Engine Design, 2nd Edition

by David Eberly
November 2006
Intermediate to advanced content levelIntermediate to advanced
1040 pages
26h 31m
English
CRC Press
Content preview from 3D Game Engine Design, 2nd Edition
13.2 Boxes 619
If U
i
are unit-length eigenvectors, the extents e
i
along those axes are computed from
the extreme values of the projections of the points onto those axes:
a
i
= min
0j<n
4
U
i
.
(V
j
C)
5
, b
i
= max
0j<n
4
U
i
.
(V
j
C)
5
, e
i
= max{|a
i
|, |b
i
|}
This box does not necessarily have the smallest volume of all boxes with the same axis
directions. For a tighter fit, adjust the center of the box and choose the extents, as
shown,tobe
C
= C +
1
2
2
i=0
(a
i
+ b
i
)U
i
, e
i
= (b
i
a
i
)/2
The pseudocode is
Box3 box; // center, axis[3], extent[3]
// Compute mean of points.
Vector3 sum = P[0];
for(i=1;i<n;i++)
{
sum += P[i];
}
box.center = sum/n;
// Compute covariances of points.
Matrix3
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

3D Game Engine Architecture

3D Game Engine Architecture

David Eberly
Blender 3D By Example - Second Edition

Blender 3D By Example - Second Edition

Oscar Baechler, Xury Greer
Computer Graphics

Computer Graphics

Alexey Boreskov, Evgeniy Shikin

Publisher Resources

ISBN: 9781482267303