Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
8518cd34
宇宙模拟器
项目概览
Python_超人
/
宇宙模拟器
通知
19
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
宇宙模拟器
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8518cd34
编写于
12月 13, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
16d07895
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
34 addition
and
10 deletion
+34
-10
bodies/README.md
bodies/README.md
+13
-0
sim_scenes/featured/the_lost_planet.py
sim_scenes/featured/the_lost_planet.py
+6
-6
sim_scenes/func.py
sim_scenes/func.py
+8
-0
sim_scenes/universe_sim_scenes.py
sim_scenes/universe_sim_scenes.py
+6
-3
simulators/ursina_simulator.py
simulators/ursina_simulator.py
+1
-1
未找到文件。
bodies/README.md
浏览文件 @
8518cd34
...
@@ -8,6 +8,19 @@
...
@@ -8,6 +8,19 @@
# 天体质量:
# 天体质量:
# 平均密度:
# 平均密度:
```
```
```
text
上标文本
参考:https://cn.piliapp.com/symbol/subscript-superscript/
⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ⁺ ⁻ ⁼ ⁽ ⁾ ⁿ
₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉ ₊ ₋ ₌ ₍ ₎
ₐ ₑ ₒ ₓ ₔ ° ⁱ
⁄ ² ³
ᴬ ᴮ ᴰ ᴱ ᴳ ᴴ ᴵ ᴶ ᴷ ᴸ ᴹ ᴺ ᴼ ᴾ ᴿ ᵀ ᵁ ⱽ ᵂ
ᵃ ᵇ ᶜ ᵈ ᵉ ᶠ ᵍ ʰ ⁱ ʲ ᵏ ˡ ᵐ ⁿ ᵒ ᵖ ʳ ˢ ᵗ ᵘ ᵛ ʷ ˣ ʸ ᶻ
ₐ ₑ ₕ ᵢ ⱼ ₖ ₗ ₘ ₙ ₒ ₚ ᵣ ₛ ₜ ᵤ ᵥ ₓ
ᵋ ᵝ ᵞ ᵟ ᵠ ᵡ ᵦ ᵧ ᵨ ᵩ ᵪ ᶥ ᶿ
```
参考:
参考:
https://solarsystem.nasa.gov/solar-system/our-solar-system/overview/
https://solarsystem.nasa.gov/solar-system/our-solar-system/overview/
https://trek.nasa.gov/mars/
https://trek.nasa.gov/mars/
...
...
sim_scenes/featured/the_lost_planet.py
浏览文件 @
8518cd34
...
@@ -317,9 +317,9 @@ class TheLostPlanetSim(UniverseSimScenes):
...
@@ -317,9 +317,9 @@ class TheLostPlanetSim(UniverseSimScenes):
# (self.asteroid_fade_out, 900, 1),
# (self.asteroid_fade_out, 900, 1),
# 第4波行星
# 第4波行星
(
self
.
camera_back_2
,
900
,
-
1
),
(
self
.
camera_back_2
,
900
,
-
1
),
(
self
.
neptune_orbit_the_sun
,
900
,
1
),
(
self
.
neptune_orbit_the_sun
,
900
0
,
1
),
(
lambda
:
None
,
-
1
,
-
1
)
(
lambda
:
exit
(
0
)
,
-
1
,
-
1
)
]
]
self
.
_steps
=
[]
self
.
_steps
=
[]
...
@@ -405,9 +405,9 @@ if __name__ == '__main__':
...
@@ -405,9 +405,9 @@ if __name__ == '__main__':
ursina_run
(
sim
.
bodies
,
ursina_run
(
sim
.
bodies
,
SECONDS_PER_YEAR
,
SECONDS_PER_YEAR
,
gravity_works
=
False
,
gravity_works
=
False
,
show_exit_button
=
False
,
#
show_exit_button=False,
show_control_info
=
False
,
#
show_control_info=False,
show_camera_info
=
False
,
#
show_camera_info=False,
# position=(0, 2 * AU, -11 * AU),
# position=(0, 2 * AU, -11 * AU),
# position=(0, 20 * AU, 10 * AU),
# position=(0, 20 * AU, 10 * AU),
# position=(4.5 * AU, AU, 5 * AU),
# position=(4.5 * AU, AU, 5 * AU),
...
@@ -416,4 +416,4 @@ if __name__ == '__main__':
...
@@ -416,4 +416,4 @@ if __name__ == '__main__':
# show_timer=True,
# show_timer=True,
cosmic_bg
=
''
,
cosmic_bg
=
''
,
# show_trail=True,
# show_trail=True,
show_grid
=
Fals
e
)
show_grid
=
Tru
e
)
sim_scenes/func.py
浏览文件 @
8518cd34
...
@@ -15,6 +15,8 @@ from common.consts import LIGHT_SPEED
...
@@ -15,6 +15,8 @@ from common.consts import LIGHT_SPEED
import
math
import
math
import
numpy
as
np
import
numpy
as
np
from
sim_scenes.universe_sim_scenes
import
UniverseSimScenes
def
calc_run
(
bodies
,
dt
=
SECONDS_PER_WEEK
,
on_init
=
None
,
**
kwargs
):
def
calc_run
(
bodies
,
dt
=
SECONDS_PER_WEEK
,
on_init
=
None
,
**
kwargs
):
from
simulators.calc_simulator
import
CalcSimulator
from
simulators.calc_simulator
import
CalcSimulator
...
@@ -193,6 +195,12 @@ def ursina_run(bodies,
...
@@ -193,6 +195,12 @@ def ursina_run(bodies,
from
simulators.ursina.entities.ursina_player
import
UrsinaPlayer
from
simulators.ursina.entities.ursina_player
import
UrsinaPlayer
body_sys
=
System
(
bodies
)
body_sys
=
System
(
bodies
)
if
UniverseSimScenes
.
screen_record
:
show_exit_button
=
False
show_control_info
=
False
show_camera_info
=
False
show_grid
=
False
if
show_name
:
if
show_name
:
for
body
in
body_sys
.
bodies
:
for
body
in
body_sys
.
bodies
:
body
.
show_name
=
True
body
.
show_name
=
True
...
...
sim_scenes/universe_sim_scenes.py
浏览文件 @
8518cd34
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
# ==============================================================================
# ==============================================================================
from
objs
import
CoreValagaClas
from
objs
import
CoreValagaClas
import
sys
import
sys
from
ursina
import
application
class
UniverseSimScenes
:
class
UniverseSimScenes
:
...
@@ -15,18 +16,20 @@ class UniverseSimScenes:
...
@@ -15,18 +16,20 @@ class UniverseSimScenes:
可以作为宇宙模拟场景的基类,但是不是必须的。
可以作为宇宙模拟场景的基类,但是不是必须的。
"""
"""
screen_record
=
False
record_rate
=
1
def
__new__
(
cls
,
*
args
,
**
kwargs
):
def
__new__
(
cls
,
*
args
,
**
kwargs
):
print
(
"参数个数"
,
len
(
sys
.
argv
))
print
(
"参数个数"
,
len
(
sys
.
argv
))
if
len
(
sys
.
argv
)
>
1
:
if
len
(
sys
.
argv
)
>
1
:
UniverseSimScenes
.
set_window_size
((
1920
,
1079
),
False
)
UniverseSimScenes
.
set_window_size
((
1920
,
1079
),
False
)
cls
.
record_rate
=
2
cls
.
record_rate
=
2
else
:
UniverseSimScenes
.
screen_record
=
True
cls
.
record_rate
=
1
application
.
time_scale
=
0.0000
1
instance
=
super
().
__new__
(
cls
,
*
args
,
**
kwargs
)
instance
=
super
().
__new__
(
cls
,
*
args
,
**
kwargs
)
return
instance
return
instance
@
staticmethod
@
staticmethod
def
create_camera_target
(
init_position
=
[
0
,
0
,
0
],
size_scale
=
1e3
):
def
create_camera_target
(
init_position
=
[
0
,
0
,
0
],
size_scale
=
1e3
):
camera_target
=
CoreValagaClas
(
name
=
"摄像机镜头"
,
mass
=
1e30
,
color
=
(
111
,
140
,
255
),
camera_target
=
CoreValagaClas
(
name
=
"摄像机镜头"
,
mass
=
1e30
,
color
=
(
111
,
140
,
255
),
...
...
simulators/ursina_simulator.py
浏览文件 @
8518cd34
...
@@ -322,7 +322,7 @@ class UrsinaSimulator(Simulator):
...
@@ -322,7 +322,7 @@ class UrsinaSimulator(Simulator):
window
.
fps_counter
.
enabled
=
False
window
.
fps_counter
.
enabled
=
False
window
.
exit_button
.
enabled
=
show_exit_button
window
.
exit_button
.
enabled
=
show_exit_button
# window.editor_ui.enabled = True
# window.editor_ui.enabled = True
# window.fullscreen_button.enabled = False
# # 场景加入雾的效果
# # 场景加入雾的效果
# scene.fog_color = color.orange
# scene.fog_color = color.orange
# scene.fog_density = 800 * UrsinaConfig.SCALE_FACTOR
# scene.fog_density = 800 * UrsinaConfig.SCALE_FACTOR
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录