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
2.05k stars 256 forks source link

setFocalOffset -- How to keep the model always facing the screen #509

Open wangguangmeng opened 5 months ago

wangguangmeng commented 5 months ago

Describe the bug

image

I noticed that when I used setFocalOffset, the angle of the model towards the screen has changed.

image

How to keep the model always facing the screen, like this:

image

Thank you

To Reproduce

...

Code

No response

Live example

No response

Expected behavior

....

Screenshots or Video

No response

Device

No response

OS

No response

Browser

No response

yomotsu commented 5 months ago

That is intended behavior. focalOffset will translate the point of orbit, literally. Consider using camera.setViewOffset: https://yomotsu.github.io/camera-controls/examples/padding-with-view-offset.html

wangguangmeng commented 5 months ago

这是预期的行为。focalOffset 将从字面上平移轨道点。考虑使用:https://yomotsu.github.io/camera-controls/examples/padding-with-view-offset.html`camera.setViewOffset`

Thank you for your reply, I am trying