Get a model bounding box

Hello I’m loading a gltf model into my view and adding it as a primitive. I need to draw a grid plan under the model like this:

I need to get the bounding box for the model so I can calculate the size of the rectangle, and I also need to get the lowest point of the bounding box so I can always place the rectangle at the base of the model.

Is there a way to get the actual coordinates of this bounding box? Or am I approaching this problem in a wrong way?

The closest thing in the actual API is getting the Model’s boundingSphere. In reality the min/max Cartesian positions do exist, but they are not easily accessible. Take a look at the computeBoundingSphere function in Model. Once you have these values you will need to transform them by the model’s modelMatrix to get the coordinates in world space. Sorry that this isn’t easier to do…