diff --git a/scenes/sun_earth_moon.py b/scenes/sun_earth_moon.py index 8069a905ea857f576cc7e3d3b9c48f64725d129f..0b1edfdfd29bad22275da12644582fb8fbe8be50 100644 --- a/scenes/sun_earth_moon.py +++ b/scenes/sun_earth_moon.py @@ -43,7 +43,7 @@ if __name__ == '__main__': # 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹 # position = 左-右+、上+下-、前+后- # position=(0, 0, 0) 的位置是站在地球视角,可以观看月相变化的过程 - ursina_run(bodies, SECONDS_PER_DAY, position=(0, 0, 0), save_as_json="../data/sun_earth_moon.json") + ursina_run(bodies, SECONDS_PER_DAY, position=(0, 0, 0)) # 使用 mayavi 查看的运行效果 # mayavi_run(bodies, SECONDS_PER_HALF_DAY / 2, view_azimuth=-45) diff --git a/simulators/ursina_simulator.py b/simulators/ursina_simulator.py index 7cdf209f45feca36828d67bef51b224d05cf416a..6cbd0c1759fbf9c4fb63d77f38dd10bacd4a0cd8 100644 --- a/simulators/ursina_simulator.py +++ b/simulators/ursina_simulator.py @@ -8,7 +8,7 @@ # ============================================================================== # pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com ursina from ursina import Ursina, window, Entity, Grid, Mesh, camera, Text, application, color, mouse, Vec2, Vec3, \ - load_texture, held_keys, distance + load_texture, held_keys, distance, Audio from ursina.prefabs.first_person_controller import FirstPersonController import itertools from simulators.ursina.ursina_event import UrsinaEvent @@ -32,6 +32,7 @@ class WorldGrid(Entity): """ 创建一个宇宙网格对象 """ + def __init__(self): super().__init__() s = 100 @@ -57,7 +58,6 @@ class UrsinaSimulator(Simulator): # self.app = Ursina(window_title='GPU模拟', # window_kwargs={'vsync': True, 'fullscreen': False, 'borderless': False, 'show_ursina_splash': True, # 'high_resolution': True}) - self.ursina_views = [] window.color = color.black @@ -275,6 +275,7 @@ class UrsinaSimulator(Simulator): EditorCamera(ignore_paused=True) # 防止打开中文输入法 # self.switch_to_english_input_method() + audio = Audio('../sounds/universe_04.mp3', pitch=1, loop=True, autoplay=True) self.app.run() diff --git a/sounds/universe_01.mp3 b/sounds/universe_01.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..3cbe884cbdeb2cb73385924357ed3d91e740e52b Binary files /dev/null and b/sounds/universe_01.mp3 differ diff --git a/sounds/universe_02.mp3 b/sounds/universe_02.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..67a55a4bfbeedac8d76494e1c822e9bb407fcd50 Binary files /dev/null and b/sounds/universe_02.mp3 differ diff --git a/sounds/universe_03.mp3 b/sounds/universe_03.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..4972b64af5b70465eb2a8712cc8a1cfa1fe11c39 Binary files /dev/null and b/sounds/universe_03.mp3 differ diff --git a/sounds/universe_04.mp3 b/sounds/universe_04.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..de02aed6fb1940613d0bdf782519a7d95ec37657 Binary files /dev/null and b/sounds/universe_04.mp3 differ