Skip to content

Commit 32eba59

Browse files
committed
Change the obstacle material to Standard and add some lights
1 parent c3c141d commit 32eba59

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

public/scripts.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,26 @@ var obstacles = [];
2020

2121
for (var i = 0; i < 100; i++) {
2222
var geometry = new THREE.BoxGeometry( 0.2, 1, 0.2 );
23-
var material = new THREE.MeshNormalMaterial( { color: 0xff0000 } );
23+
var material = new THREE.MeshStandardMaterial( { color: 0xff0000 } );
2424
var obstacle = new THREE.Mesh( geometry, material );
2525
obstacle.position.x = 10 + Math.floor(Math.random() * 300);
2626
obstacles.push(obstacle);
2727
scene.add( obstacle );
2828
}
2929

30+
var lights = [];
31+
lights[0] = new THREE.PointLight( 0xffffff, 1, 0 );
32+
lights[1] = new THREE.PointLight( 0xffffff, 1, 0 );
33+
lights[2] = new THREE.PointLight( 0xffffff, 1, 0 );
34+
35+
lights[0].position.set(0, 200, 0);
36+
lights[1].position.set(100, 200, 100);
37+
lights[2].position.set(-100, -200, -100);
38+
39+
scene.add(lights[0]);
40+
scene.add(lights[1]);
41+
scene.add(lights[2]);
42+
3043
var jumping = false;
3144
var jump_distance = 0.1;
3245
var acceleration = 0.0025;

0 commit comments

Comments
 (0)