From 2396d5b7cae6c9156940f8382d3a738e51620075 Mon Sep 17 00:00:00 2001 From: march3 Date: Sat, 11 Mar 2023 22:29:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=AA=E9=98=B3=E7=B3=BB=E4=B8=89=E4=BD=93?= =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simulators/ursina_simulator.py | 2 +- simulators/views/ursina_view.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/simulators/ursina_simulator.py b/simulators/ursina_simulator.py index cbd77e4..0c98f3b 100644 --- a/simulators/ursina_simulator.py +++ b/simulators/ursina_simulator.py @@ -99,7 +99,7 @@ class UrsinaSimulator(Simulator): light = PointLight(parent=v, intensity=10, range=10, color=color.white) light.brightness = 10 lights.append(light) - v.lights = lights + v.lights = v.lights + lights pass # PointLight(parent=camera, color=color.white, position=(0, 0, 0)) diff --git a/simulators/views/ursina_view.py b/simulators/views/ursina_view.py index b887fb5..1ff3d95 100644 --- a/simulators/views/ursina_view.py +++ b/simulators/views/ursina_view.py @@ -124,6 +124,14 @@ class UrsinaView(BodyView): if self.body.is_fixed_star: # 如果是恒星(如:太阳),自身会发光,则需要关闭灯光 self.planet.set_light_off() + self.lights = [] + self.create_light_sphere() + + def create_light_sphere(self): + for i in range(5): + light = Entity(parent=self.planet, model='sphere', color=color.rgba(1.0, 0.6, 0.2, 1), + scale=math.pow(1.03, i), alpha=0.2) + # self.lights.append(light) def create_rings(self): """ -- GitLab