提交 2396d5b7 编写于 作者: 三月三net's avatar 三月三net

太阳系三体模拟器

上级 e6620507
...@@ -99,7 +99,7 @@ class UrsinaSimulator(Simulator): ...@@ -99,7 +99,7 @@ class UrsinaSimulator(Simulator):
light = PointLight(parent=v, intensity=10, range=10, color=color.white) light = PointLight(parent=v, intensity=10, range=10, color=color.white)
light.brightness = 10 light.brightness = 10
lights.append(light) lights.append(light)
v.lights = lights v.lights = v.lights + lights
pass pass
# PointLight(parent=camera, color=color.white, position=(0, 0, 0)) # PointLight(parent=camera, color=color.white, position=(0, 0, 0))
......
...@@ -124,6 +124,14 @@ class UrsinaView(BodyView): ...@@ -124,6 +124,14 @@ class UrsinaView(BodyView):
if self.body.is_fixed_star: if self.body.is_fixed_star:
# 如果是恒星(如:太阳),自身会发光,则需要关闭灯光 # 如果是恒星(如:太阳),自身会发光,则需要关闭灯光
self.planet.set_light_off() 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): def create_rings(self):
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册