I’m happy to hear you’re enjoying the platform!
We have Universal AR ThreeJS docs over at https://docs.zap.works/universal-ar/threejs/
What you’re trying to acomplish is to check the world position distance between the camera and a group, which is more of a three question rather than Universal AR. You can find THREE docs over at https://threejs.org/docs
Most three objects have a
Vector3 which is one way of working this out.
Vector3 comes with a handy utility function distanceTo which is prefect for this.
Getting tracker group’s location:
const trackerPosition = trackerGroup.getWorldPosition()
Getting camera’s location:
const cameraPosition = camera.getWorldPosition()
Using the two positions:
const distance = trackerPosition.distanceTo(cameraPosition)
I’ve created a sandbox demo which illustrates this