yomotsu / camera-controls

A camera control for three.js, similar to THREE.OrbitControls yet supports smooth transitions and more features.
https://yomotsu.github.io/camera-controls/
MIT License
1.89k stars 241 forks source link

Add focus function #484

Closed WREQI closed 4 months ago

WREQI commented 4 months ago

Is your feature request related to a problem? Please describe.

image image The editor of three.js has an EditorControls and a focus function that can automatically and quickly locate the model

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

yomotsu commented 4 months ago

Thanks for your request. CameraControls already has fitToBox and fitToSphere. Do you still need another feature?

WREQI commented 4 months ago

image @yomotsu What should I do if I need to be at a certain distance from the object instead of completely filling it, which means that the distance can be set?

yomotsu commented 4 months ago

There are several methods such as dolly() and dollyTo(), and also can be combined with fitToXXX(). Please read the docs for more details.

https://github.com/yomotsu/camera-controls?tab=readme-ov-file#dolly-distance-enabletransition- https://github.com/yomotsu/camera-controls?tab=readme-ov-file#dollyto-distance-enabletransition-

WREQI commented 4 months ago

image Okay, thank you. @yomotsu The controller in three.js editor can bi-directional link an indicator in the bottom right corner. If CameraControls is used, how can it correctly bi-directional link an indicator? Is there a good example?

yomotsu commented 4 months ago

a good example?

Did you check all the examples in the readme? So far, there are no such examples, but you can try it yourself with CameraControls.

WREQI commented 4 months ago

MinZoom only supports orthogonal cameras? @yomotsu

yomotsu commented 4 months ago

Sorry, but please read and check the docs for further details. If you wish further support, please consider becoming a patron: the "You may get additional support" tier.