diff --git a/objs/halley_comet.py b/objs/halley_comet.py index 8d90b6b2154cf9ccb2d019ec7d072e812063199a..35acf12ac998d1aad1a5f8ab3f85b2f24a82baa5 100644 --- a/objs/halley_comet.py +++ b/objs/halley_comet.py @@ -50,7 +50,7 @@ class HalleComet(RockSnow): super().__init__(**params) # create_cone(radius, height, subdivisions, r=0.1) # 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 diff --git a/sim_scenes/solar_system/halley_comet_sim.py b/sim_scenes/solar_system/halley_comet_sim.py index 375e1701bd040d86383eacac9e33144a1723b0a9..1b169898432bd2905f1b9eac77c3db33c61199f3 100644 --- a/sim_scenes/solar_system/halley_comet_sim.py +++ b/sim_scenes/solar_system/halley_comet_sim.py @@ -155,7 +155,7 @@ class HalleyCometSim(HalleyCometSimBase): # 渐渐消失的距离范围(开始消失距离, 完全消失距离) HIDE_DISTANCE = 3, 12 # 彗星最大的透明度 - MAX_ALPHA = 1 + MAX_ALPHA = 0.8 # 大于完全消失距离 if d_au >= HIDE_DISTANCE[1]: @@ -165,8 +165,8 @@ class HalleyCometSim(HalleyCometSimBase): else: alpha = MAX_ALPHA # 修改彗星尾巴的透明度 - c = self.halley_comet.planet.comet_trail - c.alpha = alpha + self.halley_comet.planet.comet_trail.alpha = alpha + self.halley_comet.planet.comet_sphere.alpha = alpha def show_milestone_lable(self, last_trail, dt): """ diff --git a/simulators/ursina/entities/planet.py b/simulators/ursina/entities/planet.py index 5743279b0f0de17a402762640b513a83ba0f821a..d2e834533535712d1decae3ab60072cd0c4a6851 100644 --- a/simulators/ursina/entities/planet.py +++ b/simulators/ursina/entities/planet.py @@ -188,8 +188,11 @@ class Planet(Entity): position=(0, 0, 0), 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_sphere.set_light_off() def create_rotate_entity(self): """