THREE.js Orthographic camera position not updating after zoom with OrbitControl

我的未来我决定 提交于 2019-12-24 20:19:31

问题


I'm using THREE.OrbitControls to zoom a THREE.OrthographicCamera. But, even thought the ortho camera renders correctly as zoomed, all that is updating on the camera is the 'zoom' property. Even after calling camera.updateProjectionMatrix(). Do I need to manually update the 'position' property of the camera based on the updated 'zoom' property? I want to display its position in my UI.


回答1:


"Zooming" should never change a camera's position. Zooming changes the field of view of a camera, while it remains in the same position. Zooming in is the same as cropping an image.

When you move closer or further away from a subject, this is called "dolly". When you have an orthographic camera, because there is no perspective deformation, dollying has very little effect.

Do I need to manually update the 'position' property of the camera based on the updated 'zoom' property?

Yes, but "based on the..." is very very relative, for each zoom level you have infinitely many viable positions for your camera.



来源:https://stackoverflow.com/questions/55814148/three-js-orthographic-camera-position-not-updating-after-zoom-with-orbitcontrol

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!