I’m using OrbitControls and PerspectiveCamera now.
And I can control the focal length of the camera by setting maxDistance and minDistance in OrbitControls.
But how to get the current real-time focal length.
I’m using OrbitControls and PerspectiveCamera now.
And I can control the focal length of the camera by setting maxDistance and minDistance in OrbitControls.
But how to get the current real-time focal length.
OrbitControls
has a target property which represents the focus point of the controls. Have you tried to compute the distance between the camera’s position and OrbitControls.target
like so?
const distance = camera.position.distanceTo( controls.target );
I’ve solved it in this way.
Thank you very much.