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

Python超人-宇宙模拟器

上级 c157b65e
...@@ -25,7 +25,7 @@ if __name__ == '__main__': ...@@ -25,7 +25,7 @@ if __name__ == '__main__':
earth_1, earth_2, earth_3, earth_4 = create_important_pos_earths() earth_1, earth_2, earth_3, earth_4 = create_important_pos_earths()
# 创建运动的地球和云层 # 创建运动的地球和云层
earth, earth_clouds = create_earth(with_clouds=True, earth_rotation_speed=1.0, clouds_rotation_speed=1.2) earth, earth_clouds = create_earth(with_clouds=True, earth_rotation_speed=0.5, clouds_rotation_speed=0.8)
pos_vel = get_earth_pos_vel_by_term_name("寒露") pos_vel = get_earth_pos_vel_by_term_name("寒露")
......
...@@ -165,6 +165,7 @@ class SolarSystemRealitySim: ...@@ -165,6 +165,7 @@ class SolarSystemRealitySim:
def run(self, def run(self,
debug_mode=False, debug_mode=False,
start_time=None, start_time=None,
dt=None,
show_asteroids=False, show_asteroids=False,
show_earth_clouds=False, show_earth_clouds=False,
recalc_moon_pos=True, recalc_moon_pos=True,
...@@ -173,6 +174,7 @@ class SolarSystemRealitySim: ...@@ -173,6 +174,7 @@ class SolarSystemRealitySim:
模拟运行 模拟运行
@param debug_mode: 是否调试模式 @param debug_mode: 是否调试模式
@param start_time: 运行的开始时间 @param start_time: 运行的开始时间
@param dt: 运行速度(dt的值为秒数,表示1秒相当于dt的秒数)
@param show_asteroids: 是否显示小行星带 @param show_asteroids: 是否显示小行星带
@param show_earth_clouds: 地球是否显示云层(图片效果,不是真实的云层) @param show_earth_clouds: 地球是否显示云层(图片效果,不是真实的云层)
@param recalc_moon_pos: 为了更好的展示效果,需要对月球的位置重新计算(使得地月距离放大,月球相对地球方向不变) @param recalc_moon_pos: 为了更好的展示效果,需要对月球的位置重新计算(使得地月距离放大,月球相对地球方向不变)
...@@ -186,6 +188,9 @@ class SolarSystemRealitySim: ...@@ -186,6 +188,9 @@ class SolarSystemRealitySim:
self.show_earth_clouds = show_earth_clouds self.show_earth_clouds = show_earth_clouds
# 创建太阳系天体 # 创建太阳系天体
self.create_bodies() self.create_bodies()
# glows = (glow_num:10, glow_scale:1.03 glow_alpha:0.1~1)
self.sun.glows = (80, 1.005, 0.01)
# 对地球进行初始化 # 对地球进行初始化
self.init_earth() self.init_earth()
# 绑定事件 # 绑定事件
...@@ -206,9 +211,8 @@ class SolarSystemRealitySim: ...@@ -206,9 +211,8 @@ class SolarSystemRealitySim:
cosmic_bg = None cosmic_bg = None
else: else:
cosmic_bg = '' cosmic_bg = ''
if dt is None:
dt = SECONDS_PER_DAY # 1秒=1天 dt = 1 # 1秒=1秒
dt = 1 # 1秒=1秒
# 使用 ursina 查看的运行效果 # 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹 # 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# position = 左-右+、上+下-、前+后- # position = 左-右+、上+下-、前+后-
...@@ -226,13 +230,15 @@ if __name__ == '__main__': ...@@ -226,13 +230,15 @@ if __name__ == '__main__':
sim = SolarSystemRealitySim() sim = SolarSystemRealitySim()
sim.run( sim.run(
# debug_mode=True, # 是否调试模式 # debug_mode=True, # 是否调试模式
dt=SECONDS_PER_DAY / 12, # 1秒=1天
start_time='2023-10-24 00:00:00',
# start_time='2050-01-01 12:00:00', # 指定运行的开始时间,不指定为当前时间 # start_time='2050-01-01 12:00:00', # 指定运行的开始时间,不指定为当前时间
# 网上没有找到精确的日期,宇宙模拟器展示大概2040年8、9月份 # 网上没有找到精确的日期,宇宙模拟器展示大概2040年8、9月份
# start_time='2040-08-15 12:00:00', # 金木水火土五星连珠的时间 # https://baijiahao.baidu.com/s?id=1776120995339598449 # start_time='2040-08-15 12:00:00', # 金木水火土五星连珠的时间 # https://baijiahao.baidu.com/s?id=1776120995339598449
# start_time='2049-01-01 12:00:00', # 九星连珠的时间 # https://988892.com/qiwenyishi/2023061960711.html # start_time='2049-01-01 12:00:00', # 九星连珠的时间 # https://988892.com/qiwenyishi/2023061960711.html
# start_time='2149-12-10 12:00:00', # 九星连珠的时间 # https://baijiahao.baidu.com/s?id=1654160345900112362 # start_time='2149-12-10 12:00:00', # 九星连珠的时间 # https://baijiahao.baidu.com/s?id=1654160345900112362
# show_asteroids=True, # 是否显示小行星带(图片模拟) # show_asteroids=True, # 是否显示小行星带(图片模拟)
# show_earth_clouds=True, # 地球是否显示云层(图片效果,不是真实的云层) show_earth_clouds=True, # 地球是否显示云层(图片效果,不是真实的云层)
# recalc_moon_pos=False, # 为了更好的展示效果,需要对月球的位置重新计算(使得地月距离放大,月球相对地球方向不变) # recalc_moon_pos=False, # 为了更好的展示效果,需要对月球的位置重新计算(使得地月距离放大,月球相对地球方向不变)
# clock_position_center=True # 时钟是否显示在中间 clock_position_center=True # 时钟是否显示在中间
) )
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册