问题
I am a complete newbee to three.js
, and I cannot find out how to implement a "zoom all" with a OrthograpicCamera
. I have been searching on the documentation and on the web, and I have only found solutions for PerspectiveCamera
, that involve altering the field of view.
My goal is to achieve a fitting of all the 3D objects of a scene to the screen, so they are shown as bigger as possible. Any ideas to achieve this will be helpful. Thanks.
回答1:
You could calculate the 2D screen space bounding box around all the objects, and then use that to set the height and width of the orthographic camera. See how to calculate it here: ThreeJS 2D bounding box of 3D object
来源:https://stackoverflow.com/questions/45995313/three-js-orthographic-camera-zoom-all