diff --git a/sim_scenes/featured/earth_seasons_1.py b/sim_scenes/featured/earth_seasons_1.py index 0d8c5a0ca1025bc61480b48163c73a1585c5f49d..a27320998a5de78830169e16eb079854b849bf76 100644 --- a/sim_scenes/featured/earth_seasons_1.py +++ b/sim_scenes/featured/earth_seasons_1.py @@ -19,7 +19,7 @@ class EarthSeasonsSim(EarthSeasonsSimBase): super(EarthSeasonsSim, self).__init__(sun_transparent=False, show_sphere_sky=False, look_at_earth=False, - exit_at_total_days=400, + # exit_at_total_days=400, earth_cn_size_factor=1.01, show_name=False) @@ -33,4 +33,4 @@ if __name__ == '__main__': 摄像机以侧视图(秋分侧)看太阳和地球(四季和24节气) """ sim = EarthSeasonsSim() - sim.run((3 * AU, AU, 0)) + sim.run(init_position=(3 * AU, AU, 0), speed_factor=10.0) diff --git a/sim_scenes/featured/earth_seasons_2.py b/sim_scenes/featured/earth_seasons_2.py index c9d7aa6c35c6807a662cee92a3445821e945092a..471ab2db235395de138b63d07b71858fcebc23f0 100644 --- a/sim_scenes/featured/earth_seasons_2.py +++ b/sim_scenes/featured/earth_seasons_2.py @@ -19,7 +19,7 @@ class EarthSeasonsSim(EarthSeasonsSimBase): super(EarthSeasonsSim, self).__init__(sun_transparent=False, show_sphere_sky=False, look_at_earth=False, - exit_at_total_days=400, + # exit_at_total_days=400, earth_cn_size_factor=1.01, show_name=False) @@ -33,4 +33,4 @@ if __name__ == '__main__': 摄像机以侧视图(夏至侧)看太阳和地球(四季和24节气) """ sim = EarthSeasonsSim() - sim.run((0, AU, -3 * AU)) + sim.run(init_position=(0, AU, -3 * AU), speed_factor=10.0) diff --git a/sim_scenes/featured/earth_seasons_3.py b/sim_scenes/featured/earth_seasons_3.py index 3b6aaeb709c95f646606e2f21a1197351e9717bd..0308d42e098eb999c2e69e8cb8db0c8fde74c49a 100644 --- a/sim_scenes/featured/earth_seasons_3.py +++ b/sim_scenes/featured/earth_seasons_3.py @@ -13,13 +13,13 @@ from sim_scenes.func import camera_look_at class EarthSeasonsSim(EarthSeasonsSimBase): - window_size = (1920 / 3, 1080 / 3) + window_size = (1920 / 2, 1080 / 2) def __init__(self): super(EarthSeasonsSim, self).__init__(sun_transparent=False, show_sphere_sky=False, look_at_earth=False, - exit_at_total_days=400, + # exit_at_total_days=400, earth_cn_size_factor=1.01, show_name=False) @@ -33,4 +33,4 @@ if __name__ == '__main__': 摄像机以俯视图看太阳和地球(四季和24节气) """ sim = EarthSeasonsSim() - sim.run((0, 4 * AU, 0)) + sim.run(init_position=(0, 4 * AU, 0), speed_factor=10.0) diff --git a/sim_scenes/featured/earth_seasons_base.py b/sim_scenes/featured/earth_seasons_base.py index 29ad0a45ce3995b60116f091b4961117bd302ebd..883e47c4a5822ec7ae25bee480a7380762879c1e 100644 --- a/sim_scenes/featured/earth_seasons_base.py +++ b/sim_scenes/featured/earth_seasons_base.py @@ -152,7 +152,7 @@ class EarthSeasonsSimBase(UniverseSimScenes): from ursina import application, invoke def delay_app_start(): import time - time.sleep(8.0) + time.sleep(8.0 / self.speed_factor) self.wait_days_count = 0 application.paused = False @@ -199,7 +199,8 @@ class EarthSeasonsSimBase(UniverseSimScenes): # print(camera.rotation_y) - def run(self, init_position=(0, 0, 0)): + def run(self, init_position=(0, 0, 0), speed_factor=1.0): + self.speed_factor = speed_factor # 订阅事件后,上面2个函数功能才会起作用 # 运行前会触发 on_ready UrsinaEvent.on_ready_subscription(self.on_ready) @@ -210,7 +211,7 @@ class EarthSeasonsSimBase(UniverseSimScenes): # 使用 ursina 查看的运行效果 # 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹 # position = 左-右+、上+下-、前+后- - ursina_run(self.bodies, SECONDS_PER_DAY, + ursina_run(self.bodies, SECONDS_PER_DAY * speed_factor, position=init_position, # 摄像机和太阳是相同位置 show_name=self.show_name, show_grid=False,