Orbit current distance

Hi, how can we check the distance from the camera to the object on orbit camera ?

Ex. if distance from the object reach to 3-4 then we hide some other objects on the scene?

Thanks

You could track the current camera position in the way described at GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene., compute the distance while tracking, and if you find that the distance between the camera and the object is within some threshold, hide the object.