From facf840bbeb25a1b0f1f9ae1085114586b49443c Mon Sep 17 00:00:00 2001 From: march3 Date: Sun, 23 Jul 2023 17:54:12 +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 --- sim_scenes/solar_system/solar_system_reality.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sim_scenes/solar_system/solar_system_reality.py b/sim_scenes/solar_system/solar_system_reality.py index 18b33ed..337aaa0 100644 --- a/sim_scenes/solar_system/solar_system_reality.py +++ b/sim_scenes/solar_system/solar_system_reality.py @@ -73,8 +73,8 @@ if __name__ == '__main__': Earth(name="地球", size_scale=1e3), # 地球 Moon(name="月球", size_scale=2e3), # 月球 Mars(name="火星", size_scale=1.2e3), # 火星 - Jupiter(name="木星", size_scale=6e2), # 木星 - Saturn(name="土星", size_scale=6e2), # 土星 + Jupiter(name="木星", size_scale=4e2), # 木星 + Saturn(name="土星", size_scale=4e2), # 土星 Uranus(name="天王星", size_scale=10e2), # 天王星 Neptune(name="海王星", size_scale=10e2), # 海王星 ] @@ -120,19 +120,22 @@ if __name__ == '__main__': dt = time_data.get_datetime(str(current_time)) # print(time_data.get_datetime(str(current_time))) - ControlUI.current_ui.show_message(dt.strftime('%Y-%m-%d %H:%M:%S'), font="verdana.ttf", close_time=-1) + ControlUI.current_ui.show_message(dt.strftime('%Y-%m-%d %H:%M:%S'), + font="verdana.ttf", + close_time=-1) # 运行中,每时每刻都会触发 on_timer_changed UrsinaEvent.on_timer_changed_subscription(on_timer_changed) # 运行前会触发 on_ready UrsinaEvent.on_ready_subscription(on_ready) - + dt = SECONDS_PER_DAY # 1秒=1天 + dt = 1 # 1秒=1秒 # 使用 ursina 查看的运行效果 # 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹 # position = 左-右+、上+下-、前+后- - ursina_run(bodies, 1, + ursina_run(bodies, dt, position=(0, 0.2 * AU, -3 * AU), gravity_works=False, # 关闭万有引力的计算 show_grid=False, - show_timer=True) + timer_enabled=True) -- GitLab