diff --git a/chapter-01/01.03-vertices.html b/chapter-01/01.03-vertices.html
index 12c0b6b..9fbc004 100644
--- a/chapter-01/01.03-vertices.html
+++ b/chapter-01/01.03-vertices.html
@@ -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);
});
}
diff --git a/chapter-02/02.01-globe-and-camera.html b/chapter-02/02.01-globe-and-camera.html
index 7260ad0..5ba0d80 100644
--- a/chapter-02/02.01-globe-and-camera.html
+++ b/chapter-02/02.01-globe-and-camera.html
@@ -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
diff --git a/chapter-02/02.03-add-lighting.html b/chapter-02/02.03-add-lighting.html
index 2f624f3..cdc496b 100644
--- a/chapter-02/02.03-add-lighting.html
+++ b/chapter-02/02.03-add-lighting.html
@@ -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
@@ -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();
@@ -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);
diff --git a/chapter-02/02.04-starry-background.html b/chapter-02/02.04-starry-background.html
index 005d636..3623a91 100644
--- a/chapter-02/02.04-starry-background.html
+++ b/chapter-02/02.04-starry-background.html
@@ -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);
diff --git a/chapter-02/02.05-advanced-textures.html b/chapter-02/02.05-advanced-textures.html
index 8833b8e..902f7e2 100644
--- a/chapter-02/02.05-advanced-textures.html
+++ b/chapter-02/02.05-advanced-textures.html
@@ -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);