From deb70078d840cf0700b531739955ebf8bd6dc184 Mon Sep 17 00:00:00 2001 From: march3 Date: Wed, 3 May 2023 17:48:08 +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/earth/earth_moon6.py | 2 +- sim_scenes/earth/earth_satellites.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sim_scenes/earth/earth_moon6.py b/sim_scenes/earth/earth_moon6.py index 1b9bc4e..9fd60b1 100644 --- a/sim_scenes/earth/earth_moon6.py +++ b/sim_scenes/earth/earth_moon6.py @@ -66,7 +66,7 @@ if __name__ == '__main__': # 使用 ursina 查看的运行效果 # 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹 # position = 左-右+、上+下-、前+后- - ursina_run(bodies, SECONDS_PER_HOUR / 15, + ursina_run(bodies, SECONDS_PER_HOUR / 2, position=(0, 0, -4 * earth.diameter), show_trail=True, show_timer=True, diff --git a/sim_scenes/earth/earth_satellites.py b/sim_scenes/earth/earth_satellites.py index bcf1627..c3b9d49 100644 --- a/sim_scenes/earth/earth_satellites.py +++ b/sim_scenes/earth/earth_satellites.py @@ -33,6 +33,7 @@ if __name__ == '__main__': {"position": [0, 0, -10000], "velocity": [0, 6.3, 0]}, ] for i, info in enumerate(satellite_infos): + # Satellite Satellite2 satellite = Satellite(name=f'卫星{i + 1}', mass=4.4e10, size_scale=1e2, color=(255, 200, 0), init_position=info["position"], @@ -42,7 +43,6 @@ if __name__ == '__main__': def on_ready(): - camera_look_at(earth, rotation_z=0) UrsinaConfig.trail_length = 150 UrsinaConfig.trail_type = "line" pass @@ -50,7 +50,7 @@ if __name__ == '__main__': def on_timer_changed(time_data: TimeData): for info in satellite_infos: - info["satellite"].planet.look_at(earth.planet) + info["satellite"].look_at(earth) # 订阅事件后,上面2个函数功能才会起作用 @@ -63,7 +63,7 @@ if __name__ == '__main__': # 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹 # position = 左-右+、上+下-、前+后- ursina_run(bodies, SECONDS_PER_HOUR / 2, - position=(30000, 10000, -20000), + position=(0, 0, -3 * earth.diameter), show_trail=True, show_timer=True, view_closely=0.001) # 近距离观看 view_closely=True或0.001 -- GitLab