Bounding boxes. A good way to find them ¿?

Having a model with a list of polygons, how can I find the bounding box for this model?

just go through your list of vertices and find the 6 values which have the min & max x, y, and z values and that gives you the 2 vertices you need to define a bounding box.

ie. furtherst upper left and closest lower right.

And if the model is like a cylinder? How canI get the centre of the model, to find a bounding sphere?

For any kind of convex objects, you can find the ‘center’ by calculating the barycentric point of the object. How to do it …
Just sum the x value of each point of your object and then divide the result by the number of points … same for y and z and that’s it you have the center.

True…thx…