Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion chapter-01/01.03-vertices.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
vertices.forEach(function (vertex) {
var vertexSphere = new THREE.SphereGeometry(0.15);
var vertexMesh = new THREE.Mesh(vertexSphere, vertexMaterial);
vertexMesh.position = vertex;
vertexMesh.position.copy(vertex);
scene.add(vertexMesh);
});
}
Expand Down
1 change: 0 additions & 1 deletion chapter-02/02.01-globe-and-camera.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
// setup the control object for the control gui
control = new function () {
this.rotationSpeed = 0.005;
this.opacity = 0.6;
};

// add extras
Expand Down
12 changes: 6 additions & 6 deletions chapter-02/02.03-add-lighting.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@

// now add some better lighting
var ambientLight = new THREE.AmbientLight(0x111111);
ambientLight.name='ambient';
ambientLight.name = 'ambient';
scene.add(ambientLight);

// add sunlight (light
var directionalLight = new THREE.DirectionalLight(0xffffff, 1);
directionalLight.position = new THREE.Vector3(100,10,-50);
directionalLight.name='directional';
directionalLight.position.set(100, 10, -50);
directionalLight.name = 'directional';
scene.add(directionalLight);

// position and point the camera to the center of the scene
Expand All @@ -77,7 +77,7 @@
cameraControl = new THREE.OrbitControls(camera);

// setup the control object for the control gui
control = new function () {
control = new function() {
this.rotationSpeed = 0.001;
this.ambientLightColor = ambientLight.color.getHex();
this.directionalLightColor = directionalLight.color.getHex();
Expand Down Expand Up @@ -147,8 +147,8 @@
// update the camera
cameraControl.update();

scene.getObjectByName('earth').rotation.y+=control.rotationSpeed;
scene.getObjectByName('clouds').rotation.y+=control.rotationSpeed*1.1;
scene.getObjectByName('earth').rotation.y += control.rotationSpeed;
scene.getObjectByName('clouds').rotation.y += control.rotationSpeed * 1.1;

// update light colors
scene.getObjectByName('ambient').color = new THREE.Color(control.ambientLightColor);
Expand Down
2 changes: 1 addition & 1 deletion chapter-02/02.04-starry-background.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

// add sunlight (light
var directionalLight = new THREE.DirectionalLight(0xffffff, 1);
directionalLight.position = new THREE.Vector3(100,10,-50);
directionalLight.position.set(100,10,-50);
directionalLight.name='directional';
scene.add(directionalLight);

Expand Down
2 changes: 1 addition & 1 deletion chapter-02/02.05-advanced-textures.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

// add sunlight (light
var directionalLight = new THREE.DirectionalLight(0xffffff, 1);
directionalLight.position = new THREE.Vector3(200, 10, -50);
directionalLight.position.set(200, 10, -50);
directionalLight.name = 'directional';
scene.add(directionalLight);

Expand Down