Hey everyone,
I’m pretty new to BabylonJS, but loving it so far. Getting stuck on one small thing however.
As the title suggests I’m trying to dynamically calculate the focusDistance of my camera.
I’ve found two methods of achieving this:
- Using a target and calculating the distance between the camera and the target.
- Using the camera.radius directly to read the distance between the camera and the target.
However, both methods work initially as the scene loads, but when I move (zoom) the camera the value doesn’t updated.
I feel like I’m missing something simple to force the variable to update.
For anyone interested, here’s the link to the full project being developed: GitHub - scumstudios/poliwise: Poliwise Webapp