Microsoft DirectX 8.1 (Visual Basic) |
object.ComputeBoundingBox( _ PointsFVF As Any, _ NumVertices As Long, _ FVF As Long, _ MinArray As D3DVECTOR, _ MaxArray As D3DVECTOR)
If the method fails, an error is raised and Err.Number can be set to D3DERR_INVALIDCALL.
For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.
The D3DVECTOR values returned by ComputeBoundingBox are xmin, xmax, ymin, ymax, zmin, and zmax. Thus, the following defines the corners of the bounding box.
xmax, ymax, zmax xmax, ymax, zmin xmax, ymin, zmax xmax, ymin, zmin xmin, ymax, zmax xmin, ymax, zmin xmin, ymin, zmax xmin, ymin, zmin
The depth of the bounding box in the z direction is zmax - zmin, in the y direction is ymax - ymin, and in the x direction is xmax - xmin. For example, with the following minimum and maximum vectors, min (-1, -1, -1) and max (1, 1, 1), the bounding box is defined in the following manner.
1, 1, 1 1, 1, -1 1, -1, 1 1, -1, -1 -1, 1, 1 -1, 1, -1 -1, -1, 1 -1, -1, -1