提交 ebaa2b2c 编写于 作者: 三月三net's avatar 三月三net

太阳系三体模拟器

上级 fa3d28bd
......@@ -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)
......@@ -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()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册