Skip to content

Commit 407736f

Browse files
Juan GarciaJuan Garcia
Juan Garcia
authored and
Juan Garcia
committed
Playing a bit with the camera, near and far, and also the aspect ratio or fov is quite cool to understand how the perspective camera works.
1 parent 6bc5098 commit 407736f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

public/firstProject/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function init() {
1010
// fov, is the vertical field of view
1111
// aspect ratio is a relation between the width and the height, each device could have a certain ratio, so this is the relation that help us to see in the correct way what we need
1212
// near and far frustum are the planes that closes camera view. so the near should be always smaller than the far
13-
camera = new THREE.PerspectiveCamera(45, window.innerWidth/window.innerHeight, 1, 5000);
13+
camera = new THREE.PerspectiveCamera(100, window.innerWidth/window.innerHeight, 1, 1300);
1414

1515
//The position of the eye would be in this z position
1616
camera.position.z = 1000;
@@ -20,7 +20,7 @@ function init() {
2020

2121
//The material that we want for our box, is a red color wireframe
2222
material = new THREE.MeshBasicMaterial({
23-
color: 0xff0000,
23+
color: 0x0000ff,
2424
wireframe: true
2525
});
2626

0 commit comments

Comments
 (0)