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

太阳系三体模拟器

上级 dbb7ae8f
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
# python_version :3.8 # python_version :3.8
# ============================================================================== # ==============================================================================
from bodies import Sun, Earth from bodies import Sun, Earth
from common.consts import SECONDS_PER_WEEK from common.consts import SECONDS_PER_WEEK, SECONDS_PER_DAY
from scenes.func import mayavi_run, mpl_run from scenes.func import mayavi_run, mpl_run, ursina_run
if __name__ == '__main__': if __name__ == '__main__':
""" """
...@@ -50,5 +50,11 @@ if __name__ == '__main__': ...@@ -50,5 +50,11 @@ if __name__ == '__main__':
初始速度:(-3.0, 1.0, -2.0) km/s 初始速度:(-3.0, 1.0, -2.0) km/s
质量:2.8 x 10^30 kg 质量:2.8 x 10^30 kg
""" """
# 使用 mayavi 查看的运行效果
# mayavi_run(bodies, SECONDS_PER_WEEK, view_azimuth=0) # mayavi_run(bodies, SECONDS_PER_WEEK, view_azimuth=0)
# 使用 matplotlib 查看运行效果
mpl_run(bodies, SECONDS_PER_WEEK) mpl_run(bodies, SECONDS_PER_WEEK)
# 使用 ursina 查看的运行效果
# ursina_run(bodies, SECONDS_PER_WEEK, position=(0, 0, 0))
...@@ -50,16 +50,16 @@ class UrsinaPlayer(FirstPersonController): ...@@ -50,16 +50,16 @@ class UrsinaPlayer(FirstPersonController):
self.position = Vec3(pos[0], pos[1], pos[2]) self.position = Vec3(pos[0], pos[1], pos[2])
# 将摄像机位置设置为 x=0、y=1、z=0 的位置 # 将摄像机位置设置为 x=0、y=1、z=0 的位置
# camera.position = Vec3(pos[0], pos[1], pos[2]) # camera.position = Vec3(pos[0], pos[1], pos[2])
self.position = Vec3(pos[0], pos[1], pos[2]) # self.position = Vec3(pos[0], pos[1], pos[2])
# 将摄像机的观察角度绕 x 轴旋转 45 度,绕 y 轴旋转 0 度,绕 z 轴旋转 0 度 # 将摄像机的观察角度绕 x 轴旋转 45 度,绕 y 轴旋转 0 度,绕 z 轴旋转 0 度
camera.rotation = Vec3(45, 90, 0) camera.rotation = Vec3(45, 90, 0)
self.gravity = 0 # self.gravity = 0
self.vspeed = 400 # self.vspeed = 400
self.speed = 1000 # self.speed = 1000
self.mouse_sensitivity = Vec2(160, 160) # self.mouse_sensitivity = Vec2(160, 160)
self.on_enable() self.on_enable()
self.rotation_speed = 80 # self.rotation_speed = 80
def input(self, key): def input(self, key):
if key == "escape": if key == "escape":
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册