提交 3678543d 编写于 作者: 三月三net's avatar 三月三net

Python超人-宇宙模拟器

上级 fa9730f1
...@@ -50,7 +50,7 @@ class HalleComet(RockSnow): ...@@ -50,7 +50,7 @@ class HalleComet(RockSnow):
super().__init__(**params) super().__init__(**params)
# create_cone(radius, height, subdivisions, r=0.1) # create_cone(radius, height, subdivisions, r=0.1)
# self.comet_info = (0.18, 2.0, 100, 0.2) # self.comet_info = (0.18, 2.0, 100, 0.2)
self.comet_info = (0.03, 0.18, 2, 100) self.comet_info = (0.05, 0.18, 2, 100)
from ursina.prefabs.primitives import Shader from ursina.prefabs.primitives import Shader
......
...@@ -155,7 +155,7 @@ class HalleyCometSim(HalleyCometSimBase): ...@@ -155,7 +155,7 @@ class HalleyCometSim(HalleyCometSimBase):
# 渐渐消失的距离范围(开始消失距离, 完全消失距离) # 渐渐消失的距离范围(开始消失距离, 完全消失距离)
HIDE_DISTANCE = 3, 12 HIDE_DISTANCE = 3, 12
# 彗星最大的透明度 # 彗星最大的透明度
MAX_ALPHA = 1 MAX_ALPHA = 0.8
# 大于完全消失距离 # 大于完全消失距离
if d_au >= HIDE_DISTANCE[1]: if d_au >= HIDE_DISTANCE[1]:
...@@ -165,8 +165,8 @@ class HalleyCometSim(HalleyCometSimBase): ...@@ -165,8 +165,8 @@ class HalleyCometSim(HalleyCometSimBase):
else: else:
alpha = MAX_ALPHA alpha = MAX_ALPHA
# 修改彗星尾巴的透明度 # 修改彗星尾巴的透明度
c = self.halley_comet.planet.comet_trail self.halley_comet.planet.comet_trail.alpha = alpha
c.alpha = alpha self.halley_comet.planet.comet_sphere.alpha = alpha
def show_milestone_lable(self, last_trail, dt): def show_milestone_lable(self, last_trail, dt):
""" """
......
...@@ -188,8 +188,11 @@ class Planet(Entity): ...@@ -188,8 +188,11 @@ class Planet(Entity):
position=(0, 0, 0), position=(0, 0, 0),
rotation=(0, 90, 90), double_sided=True, alpha=0.8) rotation=(0, 90, 90), double_sided=True, alpha=0.8)
self.comet_sphere = Entity(parent=self, model="sphere", texture="",
color=color.white, scale=2.2, double_sided=True, alpha=0.6)
# 设置行星环不受灯光影响,否则看不清行星环 # 设置行星环不受灯光影响,否则看不清行星环
self.comet_trail.set_light_off() self.comet_trail.set_light_off()
self.comet_sphere.set_light_off()
def create_rotate_entity(self): def create_rotate_entity(self):
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册