From 2c16813da2562cfbe57c977d9e7eb67f5817375e Mon Sep 17 00:00:00 2001 From: march3 Date: Tue, 26 Mar 2024 22:37:14 +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/featured/tri_bodies_01.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sim_scenes/featured/tri_bodies_01.py b/sim_scenes/featured/tri_bodies_01.py index bc5da22..4d4ed0f 100644 --- a/sim_scenes/featured/tri_bodies_01.py +++ b/sim_scenes/featured/tri_bodies_01.py @@ -40,10 +40,17 @@ if __name__ == '__main__': # 使用 mayavi 查看的运行效果 # mayavi_run(bodies, SECONDS_PER_WEEK, view_azimuth=0) def on_ready(): + from ursina import Text, color window.borderless = False sky = create_sphere_sky(scale=80000, texture="bg_pan_deep_blue.jpg") camera.clip_plane_near = 1 camera.clip_plane_far = sky.scale_x * 1.5 + font = "fonts/DroidSansFallback.ttf" + from common.func import find_file + font = find_file(f"{font}", UrsinaConfig.CN_FONT) + + text = Text(text="万有引力模拟三体", color=color.white,scale=1.5, position=(-0.85, 0.48), + font=font) def on_timer_changed(time_data: TimeData): @@ -61,6 +68,9 @@ if __name__ == '__main__': elif 10800 < total_days < 12000: camera.position += camera.right * 1 # elif total_days > 10765: + elif 12800 < total_days < 16000: + ec.target_z -= 5 + camera.position += camera.up * 0.3 elif total_days > 17000: UrsinaEvent.on_reset() # camera.position = UrsinaConfig.SCALE_FACTOR * np.array([10 * AU, -2 * AU, -20 * AU]), -- GitLab