Graphics Reference
In-Depth Information
B oc
la
B oc
Axis-aligned
bounding boxes
in WC
in WC
la in OC
M la
WC
Transformed
to WC
OC of
Left Arm
B wc
B wc
la
B o b
in OC
M b
B o b
in WC
Transformed
to WC
B w b
OC of
Body
Figure 11.21.
Coordinate transformations of scene node bounding boxes.
class UWB _ SceneNode {
.
Source file.
uwbgl _ SceneNode2.h file
in the Common Files/ Sce-
neNode
UWB _ BoundingBox GetBounds(...) const ;
// Compute a Bounding Box in WC space that encloses all the
// primitives of this node including that of all children nodes
A:
subfolder
of
the
UWBGL _ D3D _ Lib12 project.
bool GetNodeBounds( const UWB _ SceneNode * pSearchNode ...) const ;
// pSearchNode is a children of this node, this function
// computes a Bounding Box in WC space that encloses all the
// primitives of pSearchNode including that of all it children
// nodes
B:
}
Listing 11.12. The SceneNode bounding box support.
To compute the WC bounding box for this hierarchy, we invoke the GetBounds()
function of the body node:
Compute bounding box in OC (A). At label A, the OC bounding box B oc
b
is computed.
Compute OC-to-WC transformation (B). At label B, the M b matrix is
concatenated to the top of the matrix stack. At this point, the top of the
matrix stack contains the OC-to-WC transformation matrix.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search