Skip to content

Commit 08d4ff2

Browse files
committed
Adjust hardcoded camera values
1 parent 5a08c55 commit 08d4ff2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

public/scripts.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var scene = new THREE.Scene();
2-
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
2+
var camera = new THREE.PerspectiveCamera( 45, window.innerWidth/window.innerHeight, 0.1, 1000 );
33
var keyboard = new THREEx.KeyboardState();
44
var clock = new THREE.Clock();
55

@@ -73,13 +73,13 @@ function degrees_to_radians(degrees)
7373
}
7474

7575
function oscillateCamera() {
76-
thetaX += 0.1;
77-
thetaY += 0.05;
78-
thetaZ += 0.05;
76+
thetaX += 0.3;
77+
thetaY += 0.03;
78+
thetaZ += 0.001;
7979

8080
camera.position.x = radius * Math.sin( degrees_to_radians( thetaX ) );
8181
camera.position.y = radius * Math.sin( degrees_to_radians( thetaY ) );
82-
camera.position.z = 3 + radius * Math.cos( degrees_to_radians( thetaZ ) );
82+
camera.position.z = 10 + radius * Math.cos( degrees_to_radians( thetaZ ) );
8383
camera.lookAt( scene.position );
8484
}
8585

@@ -91,8 +91,8 @@ var animate = function () {
9191
for (var i = 0; i < obstacles.length; i++) {
9292
obstacles[i].position.x -= 0.05;
9393

94-
if (obstacles[i].position.x < (initial_x - 15)) {
95-
obstacles[i].position.x = 10 + Math.floor(Math.random() * 300);
94+
if (obstacles[i].position.x < (initial_x - 50)) {
95+
obstacles[i].position.x = player.position.x + 20 + Math.floor(Math.random() * 300);
9696
}
9797
}
9898

@@ -155,7 +155,7 @@ var animate = function () {
155155

156156
var trail = new THREE.Mesh(
157157
geometry,
158-
new THREE.MeshBasicMaterial( { color: 0x555555, opacity: 0.8, transparent: true } )
158+
new THREE.MeshBasicMaterial( { color: 0x444444, opacity: 0.8, transparent: true } )
159159
);
160160

161161
trail.position.x = player.position.x;

0 commit comments

Comments
 (0)