Graphics Reference
In-Depth Information
How it works...
The easiest way to understand how this camera works is by looking at the following
figure:
The box you see in this figure is the area an orthographic camera renders. In this
figure, you can also see the left , right , top , and bottom properties we defined
on the camera, which define the boundaries of this box. The final two properties,
which are near and far , are used to define the near plane and the far plane.
With these six properties, we can define the complete box that is rendered with
THREE.OrthographicCamera .
There's more…
We can also configure THREE.OrthographicCamera by passing in these argu-
ments in the constructor:
camera = new
THREE.OrthographicCamera(window.innerWidth /
-2, window.innerWidth / 2, window.innerHeight /
2, window.innerHeight / - 2, 0.1, 1500);
An added advantage is that this way, you don't need to explicitly call cam-
era.updateProjectionMatrix() .
See also
• Three.js provides two types of camera. If you want to use
THREE.PerspectiveCamera instead, look at the Using a perspective cam-
Search WWH ::




Custom Search