From 91e0e4ebfe315150fa5fd84ac42084c336861e53 Mon Sep 17 00:00:00 2001 From: march3 Date: Sun, 5 Mar 2023 20:21:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=AA=E9=98=B3=E7=B3=BB=E4=B8=89=E4=BD=93?= =?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 --- scenes/solar_system_1.py | 7 ++----- scenes/solar_system_2.py | 8 +++++--- scenes/sun_earth.py | 7 ++----- scenes/three_body_01.py | 6 ++---- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/scenes/solar_system_1.py b/scenes/solar_system_1.py index 5a28000..beeb659 100644 --- a/scenes/solar_system_1.py +++ b/scenes/solar_system_1.py @@ -8,7 +8,7 @@ # ============================================================================== from bodies import Sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto, Moon from common.consts import SECONDS_PER_WEEK, SECONDS_PER_DAY -from scenes.func import mayavi_run +from scenes.func import mayavi_run, ursina_run if __name__ == '__main__': # 八大行星:木星(♃)、土星(♄)、天王星(♅)、海王星(♆)、地球(⊕)、金星(♀)、火星(♂)、水星(☿) @@ -34,7 +34,4 @@ if __name__ == '__main__': # mayavi_run(bodies, SECONDS_PER_WEEK, view_azimuth=-45) - from scenes.func import ursina_run - light = True - cosmic_bg = '../textures/cosmic1.png' - ursina_run(bodies, SECONDS_PER_DAY, position=(0, 0, 0), light=light, cosmic_bg=cosmic_bg) \ No newline at end of file + ursina_run(bodies, SECONDS_PER_DAY, position=(0, 0, 0)) \ No newline at end of file diff --git a/scenes/solar_system_2.py b/scenes/solar_system_2.py index e68e1c1..7b60db3 100644 --- a/scenes/solar_system_2.py +++ b/scenes/solar_system_2.py @@ -7,8 +7,8 @@ # python_version :3.8 # ============================================================================== from bodies import Sun, Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune, Pluto -from common.consts import SECONDS_PER_WEEK -from scenes.func import mayavi_run +from common.consts import SECONDS_PER_WEEK, SECONDS_PER_DAY +from scenes.func import mayavi_run, ursina_run if __name__ == '__main__': # 八大行星:木星(♃)、土星(♄)、天王星(♅)、海王星(♆)、地球(⊕)、金星(♀)、火星(♂)、水星(☿) @@ -36,4 +36,6 @@ if __name__ == '__main__': ] # endregion - mayavi_run(bodies, SECONDS_PER_WEEK, view_azimuth=-45, view_distance=3e9, view_focalpoint=[5e2, 5e2, 5e2]) + # mayavi_run(bodies, SECONDS_PER_WEEK, view_azimuth=-45, view_distance=3e9, view_focalpoint=[5e2, 5e2, 5e2]) + + ursina_run(bodies, SECONDS_PER_DAY, position=(0, 0, 0)) \ No newline at end of file diff --git a/scenes/sun_earth.py b/scenes/sun_earth.py index ea061a8..c371726 100644 --- a/scenes/sun_earth.py +++ b/scenes/sun_earth.py @@ -8,7 +8,7 @@ # ============================================================================== from bodies import Sun, Earth from common.consts import SECONDS_PER_WEEK, SECONDS_PER_DAY -from scenes.func import mayavi_run +from scenes.func import mayavi_run, ursina_run if __name__ == '__main__': """ @@ -20,7 +20,4 @@ if __name__ == '__main__': ] # mayavi_run(bodies, SECONDS_PER_WEEK, view_azimuth=-45) - from scenes.func import ursina_run - light = True - cosmic_bg = '../textures/cosmic1.png' - ursina_run(bodies, SECONDS_PER_DAY, position=(0, 0, 0), light=light, cosmic_bg=cosmic_bg) + ursina_run(bodies, SECONDS_PER_DAY, position=(0, 0, 0)) diff --git a/scenes/three_body_01.py b/scenes/three_body_01.py index eb81eb4..ed17267 100644 --- a/scenes/three_body_01.py +++ b/scenes/three_body_01.py @@ -28,10 +28,8 @@ if __name__ == '__main__': Earth(init_position=[0, -349597870.700, 0], init_velocity=[15.50, 0, 0], size_scale=4e3, distance_scale=1), # 地球放大 4000 倍,距离保持不变 ] + # 使用 mayavi 查看的运行效果 # mayavi_run(bodies, SECONDS_PER_WEEK, view_azimuth=0) # 使用 ursina 查看的运行效果 - from scenes.func import ursina_run - light = True - cosmic_bg = '../textures/cosmic1.png' - ursina_run(bodies, SECONDS_PER_DAY, position=(0, 0, 0), light=light, cosmic_bg=cosmic_bg) \ No newline at end of file + ursina_run(bodies, SECONDS_PER_DAY, position=(0, 0, 0)) \ No newline at end of file -- GitLab