I have a 3D model, and I want to display it similarly to the sample image below on mobile devices with different aspect ratios. What should be the right approach to achieve this using an orthographic camera?
Most likely you would want to do this:
- get the horizontal and vertical size of the model (with
THREE.Box3
and its methodsetFromObject
) - scale the model so that its size fits the canvas (with the camera’s
zoom
property andupdateProjectionMatrix
method)
Demo:
1 Like