SceneKit - updating scale not updating bounding box?

56 Views Asked by At

I'm loading a model from a USDC file.

After loading it in, I update the scale like so:

       modelNode.scale = SCNVector3(
           targetX/(modelNode.boundingBox.max.x - modelNode.boundingBox.min.x),
            targetY/(modelNode.boundingBox.max.y - modelNode.boundingBox.min.y),
            targetZ/(modelNode.boundingBox.max.z - modelNode.boundingBox.min.z)
        )
        

but when I go to check the new bounding box for the node, it still returns the original size bounding box.

From the docs, it seems like SceneKit should calculate this box for me automatically based on the geometry. Do I need to set it myself?

I need to find out the bounding box that the model is taking up in my world.

0

There are 0 best solutions below