提交 6668868a 编写于 作者: 三月三net's avatar 三月三net

Python超人-宇宙模拟器

上级 7c98740d
...@@ -88,7 +88,7 @@ class 模拟场景(UniverseSimScenes): ...@@ -88,7 +88,7 @@ class 模拟场景(UniverseSimScenes):
# 运行前触发 # 运行前触发
self.sky = create_sphere_sky(texture="bg_pan2.jpg", scale=500000, rotation_x=20, rotation_y=160, rotation_z=20) self.sky = create_sphere_sky(texture="bg_pan2.jpg", scale=500000, rotation_x=20, rotation_y=160, rotation_z=20)
# UrsinaConfig.trail_type = "line" UrsinaConfig.trail_type = "line"
# UrsinaConfig.trail_length = 91 # UrsinaConfig.trail_length = 91
# UrsinaConfig.trail_type = "line" # UrsinaConfig.trail_type = "line"
UrsinaConfig.trail_length = 420 UrsinaConfig.trail_length = 420
...@@ -139,8 +139,14 @@ class 太阳系模拟场景(模拟场景): ...@@ -139,8 +139,14 @@ class 太阳系模拟场景(模拟场景):
start_time=start_time, start_time=start_time,
days=orbital_days, days=orbital_days,
segments=100) segments=100)
if self.配置项.中心天体 is None:
center_pos = center_body.position
else:
center_pos = np.array([0.0, 0.0, 0.0])
# print(points) # print(points)
orbit_line = create_orbit_by_points(center_body.position, points, line_color=body.trail_color, orbit_line = create_orbit_by_points(center_pos, points, line_color=body.trail_color,
alpha=alpha) alpha=alpha)
return orbit_line return orbit_line
......
...@@ -13,7 +13,7 @@ class 太阳系模拟(太阳系模拟场景): ...@@ -13,7 +13,7 @@ class 太阳系模拟(太阳系模拟场景):
def 配置(self, 配置项: 模拟配置): def 配置(self, 配置项: 模拟配置):
配置项.显示轨道 = 打开 配置项.显示轨道 = 打开
配置项.地月距离倍数 = 20 配置项.地月距离倍数 = 20
配置项.中心天体 = self.太阳 # 配置项.中心天体 = self.太阳
def 造物(self): def 造物(self):
self.太阳 = 造物主.造物(名称='太阳', 缩放倍数=1e1) self.太阳 = 造物主.造物(名称='太阳', 缩放倍数=1e1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册