简体   繁体   中英

three.js Orthographic Camera: Zoom All

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM