Skip to content

Commit 196a069

Browse files
committed
fix camera tutorial
1 parent be1d181 commit 196a069

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tutorials/camera.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
## The "Camera" and the Projection and View Transforms
22

3-
The `Scene3D` class has a concept of a "projection transform" and a "view transform". If we use the concept of a "camera", the projection is like setting the camera's focus and lens, and the view transform is like setting its position and orientation. `Scene3D` has methods for setting all these attributes of this abstract "camera". Two of them are `setPerspective()` and `setLookAt(), which are shown in the example below.
3+
The `Scene3D` class has a concept of a "projection transform" and a "view transform". If we use the concept of a "camera", the projection is like setting the camera's focus and lens, and the view transform is like setting its position and orientation. `Scene3D` has methods for setting all these attributes of this abstract "camera". Two of them are `setPerspective()` and `setLookAt()`, which are shown in the example below.
44

5-
// Set the perspective view. Camera has a 45-degree field of view
6-
// and will see objects from 0.1 to 100 units away.
7-
scene.setPerspective(45,scene.getAspect(),0.1,100);
8-
// Move the camera back 40 units.
9-
scene.setLookAt([0,0,40]);
10-
// Move the camera back 30 units instead, and turn it so it
11-
// points at (0, 2, 0), that is, up 2 units.
12-
scene.setLookAt([0,0,30], [0,2,0]);
5+
// Set the perspective view. Camera has a 45-degree field of view
6+
// and will see objects from 0.1 to 100 units away.
7+
scene.setPerspective(45,scene.getAspect(),0.1,100);
8+
// Move the camera back 40 units.
9+
scene.setLookAt([0,0,40]);
10+
// Move the camera back 30 units instead, and turn it so it
11+
// points at (0, 2, 0), that is, up 2 units.
12+
scene.setLookAt([0,0,30], [0,2,0]);
1313

1414
In 3D graphics, the two most commonly used projections are the perspective projection and the orthographic projection. Both are described in detail below.
1515

0 commit comments

Comments
 (0)