瀏覽代碼

lighting corrections for new three.js version

Falko Schindler 1 年之前
父節點
當前提交
1a2f526333
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 2
      nicegui/elements/scene.js
  2. 2 2
      nicegui/elements/scene_objects.py

+ 2 - 2
nicegui/elements/scene.js

@@ -70,8 +70,8 @@ export default {
     this.camera.up = new THREE.Vector3(0, 0, 1);
     this.camera.position.set(0, -3, 5);
 
-    this.scene.add(new THREE.AmbientLight(0xffffff, 0.7));
-    const light = new THREE.DirectionalLight(0xffffff, 0.3);
+    this.scene.add(new THREE.AmbientLight(0xffffff, 0.7 * Math.PI));
+    const light = new THREE.DirectionalLight(0xffffff, 0.3 * Math.PI);
     light.position.set(5, 10, 40);
     this.scene.add(light);
 

+ 2 - 2
nicegui/elements/scene_objects.py

@@ -292,9 +292,9 @@ class SpotLight(Object3D):
         :param color: CSS color string (default: '#ffffff')
         :param intensity: light intensity (default: 1.0)
         :param distance: maximum distance of light (default: 0.0)
-        :param angle: maximum angle of light (default: π/3)
+        :param angle: maximum angle of light (default: π/2)
         :param penumbra: penumbra (default: 0.0)
-        :param decay: decay (default: 1.0)
+        :param decay: decay (default: 2.0)
         """
         super().__init__('spot_light', color, intensity, distance, angle, penumbra, decay)