TW's Camera Setup
This page illustrates how TW sets up a camera given only the scene
bounding box and the desired FOVY. The scene has a blue box matching the
scene bounding box, and a green wireframe sphere matching the scene
bounding sphere.
There are two canvases (teal outlines):
- the first is a visualization of the camera setup, using a 2D
slice through the second.
- The second is what the camera sees.
Additional legend:
- The blue area is the scene bounding box. The green area is the
bounding sphere. (The box doesn't touch the sphere in the 2D
slice, because we're slicing through the center of the box, not the
corners.)
- The green area is the scene bounding sphere (wireframe).
- In the 2D slice, the eye is at the rightmost vertex of the
triangle.
- The red triangle shows the shape of the frustum.
Camera Setup Demo
This demo shows a TW.camera
object based on a
THREE.PerspectiveCamera()
object.
Here are the functions that set up this camera:
and, crucially, this one: