From 6668868a025caf1dadd28813669bd4148abd8871 Mon Sep 17 00:00:00 2001 From: march3 Date: Mon, 25 Mar 2024 15:21:10 +0800 Subject: [PATCH] =?UTF-8?q?Python=E8=B6=85=E4=BA=BA-=E5=AE=87=E5=AE=99?= =?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 --- ...346\250\241\346\213\237\345\234\272\346\231\257.py" | 10 ++++++++-- .../\345\244\252\351\230\263\347\263\273.py" | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git "a/\345\274\225\345\212\233\344\270\226\347\225\214/\346\250\241\346\213\237\345\234\272\346\231\257.py" "b/\345\274\225\345\212\233\344\270\226\347\225\214/\346\250\241\346\213\237\345\234\272\346\231\257.py" index ef42e84..7243d0f 100644 --- "a/\345\274\225\345\212\233\344\270\226\347\225\214/\346\250\241\346\213\237\345\234\272\346\231\257.py" +++ "b/\345\274\225\345\212\233\344\270\226\347\225\214/\346\250\241\346\213\237\345\234\272\346\231\257.py" @@ -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) - # UrsinaConfig.trail_type = "line" + UrsinaConfig.trail_type = "line" # UrsinaConfig.trail_length = 91 # UrsinaConfig.trail_type = "line" UrsinaConfig.trail_length = 420 @@ -139,8 +139,14 @@ class 太阳系模拟场景(模拟场景): start_time=start_time, days=orbital_days, segments=100) + + if self.配置项.中心天体 is None: + center_pos = center_body.position + else: + center_pos = np.array([0.0, 0.0, 0.0]) + # 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) return orbit_line diff --git "a/\345\274\225\345\212\233\344\270\226\347\225\214/\346\250\241\346\213\237\345\256\236\351\252\214\345\256\244/\345\244\252\351\230\263\347\263\273/\345\244\252\351\230\263\347\263\273.py" "b/\345\274\225\345\212\233\344\270\226\347\225\214/\346\250\241\346\213\237\345\256\236\351\252\214\345\256\244/\345\244\252\351\230\263\347\263\273/\345\244\252\351\230\263\347\263\273.py" index a9539d0..17b62a1 100644 --- "a/\345\274\225\345\212\233\344\270\226\347\225\214/\346\250\241\346\213\237\345\256\236\351\252\214\345\256\244/\345\244\252\351\230\263\347\263\273/\345\244\252\351\230\263\347\263\273.py" +++ "b/\345\274\225\345\212\233\344\270\226\347\225\214/\346\250\241\346\213\237\345\256\236\351\252\214\345\256\244/\345\244\252\351\230\263\347\263\273/\345\244\252\351\230\263\347\263\273.py" @@ -13,7 +13,7 @@ class 太阳系模拟(太阳系模拟场景): def 配置(self, 配置项: 模拟配置): 配置项.显示轨道 = 打开 配置项.地月距离倍数 = 20 - 配置项.中心天体 = self.太阳 + # 配置项.中心天体 = self.太阳 def 造物(self): self.太阳 = 造物主.造物(名称='太阳', 缩放倍数=1e1) -- GitLab