# How do I convert two vectors into a bounding box with 8 vertices?

I created two vectors named bboxmin and bboxmax using the functions vector3 applymin_xyz() and vector3 applymax_xyz().

How do I convert them to 8 vertices,so I can test cull with them?

• It is very unclear what you're asking. What technology do you use? May 29 '15 at 9:35

For an axis-aligned bounding box represented by a minimum and maximum corner, you can extract six pieces of information, xMin, yMin, zMin, xMax, yMax, zMax.

Given those, you can construct your eight vertices as all combinations of the min and max values for each component:

{ xMin, yMin, zMin },
{ xMin, yMin, zMax },
{ xMin, yMax, zMin },
{ xMin, yMax, zMax },
{ xMax, yMin, zMin },
{ xMax, yMin, zMax },
{ xMax, yMax, zMin },
{ xMax, yMax, zMax },

Of course, normally you would not do this conversion to a polyhedron, but instead work with separating axes or possibly the plane equations. You may want to consult Christer Ericson's Real-Time Collision Detection book and the table of intersection methods from Real-Time Rendering.