Jelajahi Sumber

Deploying to github pages.

Simon 5 tahun lalu
induk
melakukan
1cbe0b7c4a
2 mengubah file dengan 5 tambahan dan 2 penghapusan
  1. 1 0
      base.css
  2. 4 2
      main.js

+ 1 - 0
base.css

@@ -40,6 +40,7 @@
   height: 500px;
   background-color: rgba(0, 0, 0, 0.5);
   margin-top: 20px;
+  box-shadow: 4px 4px black;
 }
 
 .sectionText {

+ 4 - 2
main.js

@@ -38,7 +38,7 @@ class Website3DDemo {
 
     this._scene = new THREE.Scene();
 
-    let light = new THREE.DirectionalLight(0xFFFFFF, 1.0);
+    let light = new THREE.DirectionalLight(0xFFFFFF);
     light.position.set(20, 100, 10);
     light.target.position.set(0, 0, 0);
     light.castShadow = true;
@@ -105,8 +105,10 @@ class Website3DDemo {
   }
 
   OnScroll(pos) {
+    const a = 15;
+    const b = -15;
     const amount = Math.min(pos / 500.0, 1.0);
-    this._camera.position.set(-15 + amount * (15 - -15), 15, 20);
+    this._camera.position.set(a + amount * (b - a), 15, 20);
     this._controls.update();
   }