Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
d0849ca1
宇宙模拟器
项目概览
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看板
提交
d0849ca1
编写于
4月 07, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
bd34448f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
15 deletion
+15
-15
sim_scenes/func.py
sim_scenes/func.py
+12
-12
sim_scenes/solar_system/speed_of_light.py
sim_scenes/solar_system/speed_of_light.py
+3
-3
未找到文件。
sim_scenes/func.py
浏览文件 @
d0849ca1
...
@@ -163,18 +163,18 @@ def create_solar_system_bodies(ignore_mass=False, init_velocity=None):
...
@@ -163,18 +163,18 @@ def create_solar_system_bodies(ignore_mass=False, init_velocity=None):
@return:
@return:
"""
"""
from
bodies
import
Sun
,
Mercury
,
Venus
,
Earth
,
Mars
,
Jupiter
,
Saturn
,
Uranus
,
Neptune
,
Pluto
from
bodies
import
Sun
,
Mercury
,
Venus
,
Earth
,
Mars
,
Jupiter
,
Saturn
,
Uranus
,
Neptune
,
Pluto
sun
=
Sun
(
name
=
"太阳"
,
size_scale
=
0.
6e2
)
# 太阳放大 6
0 倍,距离保持不变
sun
=
Sun
(
name
=
"太阳"
,
size_scale
=
0.
5e2
)
# 太阳放大 5
0 倍,距离保持不变
bodies
=
[
bodies
=
[
sun
,
sun
,
Mercury
(
name
=
"水星"
,
size_scale
=
2e3
),
# 水星放大 2
000 倍,距离保持不变
Mercury
(
name
=
"水星"
,
size_scale
=
1e3
),
# 水星放大 1
000 倍,距离保持不变
Venus
(
name
=
"金星"
,
size_scale
=
2e3
),
# 金星放大 2
000 倍,距离保持不变
Venus
(
name
=
"金星"
,
size_scale
=
1e3
),
# 金星放大 1
000 倍,距离保持不变
Earth
(
name
=
"地球"
,
size_scale
=
2e3
),
# 地球放大 2
000 倍,距离保持不变
Earth
(
name
=
"地球"
,
size_scale
=
1e3
),
# 地球放大 1
000 倍,距离保持不变
Mars
(
name
=
"火星"
,
size_scale
=
2e3
),
# 火星放大 2
000 倍,距离保持不变
Mars
(
name
=
"火星"
,
size_scale
=
1e3
),
# 火星放大 1
000 倍,距离保持不变
# Asteroids(name="小行星群", size_scale=3.2e2,
# Asteroids(name="小行星群", size_scale=3.2e2,
# parent=sun), # 小行星群模拟(仅 ursina 模拟器支持)
# parent=sun), # 小行星群模拟(仅 ursina 模拟器支持)
Jupiter
(
name
=
"木星"
,
size_scale
=
0.
5e3
),
# 木星放大 5
00 倍,距离保持不变
Jupiter
(
name
=
"木星"
,
size_scale
=
0.
3e3
),
# 木星放大 3
00 倍,距离保持不变
Saturn
(
name
=
"土星"
,
size_scale
=
0.
5e3
),
# 土星放大 5
00 倍,距离保持不变
Saturn
(
name
=
"土星"
,
size_scale
=
0.
3e3
),
# 土星放大 3
00 倍,距离保持不变
Uranus
(
name
=
"天王星"
,
size_scale
=
0.
6e3
),
# 天王星放大 6
00 倍,距离保持不变
Uranus
(
name
=
"天王星"
,
size_scale
=
0.
4e3
),
# 天王星放大 4
00 倍,距离保持不变
Neptune
(
name
=
"海王星"
,
size_scale
=
1e3
),
# 海王星放大 1000 倍,距离保持不变
Neptune
(
name
=
"海王星"
,
size_scale
=
1e3
),
# 海王星放大 1000 倍,距离保持不变
Pluto
(
name
=
"冥王星"
,
size_scale
=
10e3
),
# 冥王星放大 10000 倍,距离保持不变(从太阳系的行星中排除)
Pluto
(
name
=
"冥王星"
,
size_scale
=
10e3
),
# 冥王星放大 10000 倍,距离保持不变(从太阳系的行星中排除)
]
]
...
@@ -205,18 +205,18 @@ def create_text_panel(width=0.35, height=.5):
...
@@ -205,18 +205,18 @@ def create_text_panel(width=0.35, height=.5):
parent
=
None
,
parent
=
None
,
model
=
'quad'
,
model
=
'quad'
,
# texture='white_cube',
# texture='white_cube',
color
=
color
.
gray
,
color
=
color
.
black
,
origin
=
(
-
.
48
,
.
48
),
origin
=
(
-
.
48
,
.
48
,
-
.
48
),
scale
=
(
width
,
height
),
scale
=
(
width
,
height
),
position
=
(
-
.
88
,
0.3
,
0
),
position
=
(
-
.
88
,
0.3
,
0
),
alpha
=
0.
2
alpha
=
0.
5
)
)
# 创建一个 Text 组件用于显示消息
# 创建一个 Text 组件用于显示消息
text
=
Text
(
text
=
Text
(
parent
=
panel
,
parent
=
panel
,
text
=
''
,
text
=
''
,
origin
=
(
-
.
5
,
.
5
),
origin
=
(
-
.
5
,
.
5
,
-
.
5
),
scale
=
(
height
*
5
,
width
*
5
),
scale
=
(
height
*
5
,
width
*
5
),
font
=
UrsinaConfig
.
CN_FONT
,
font
=
UrsinaConfig
.
CN_FONT
,
# background=True,
# background=True,
...
...
sim_scenes/solar_system/speed_of_light.py
浏览文件 @
d0849ca1
...
@@ -18,8 +18,8 @@ text_panel = None
...
@@ -18,8 +18,8 @@ text_panel = None
arrived_info
=
""
arrived_info
=
""
CAMERA_FOLLOW_LIGHT
=
None
# 不跟随光
CAMERA_FOLLOW_LIGHT
=
None
# 不跟随光
#
CAMERA_FOLLOW_LIGHT = 'ForwardView' # 向前看
CAMERA_FOLLOW_LIGHT
=
'ForwardView'
# 向前看
#
CAMERA_FOLLOW_LIGHT = 'SideView' # 侧面看
CAMERA_FOLLOW_LIGHT
=
'SideView'
# 侧面看
def
on_reset
():
def
on_reset
():
...
@@ -87,7 +87,7 @@ else:
...
@@ -87,7 +87,7 @@ else:
# 摄像机位置 = 左-右+、上+下-、前+后-
# 摄像机位置 = 左-右+、上+下-、前+后-
position
=
(
0
,
AU
,
-
6
*
AU
)
position
=
(
0
,
AU
,
-
6
*
AU
)
show_trail
=
True
show_trail
=
True
light_size_scale
=
5
e3
light_size_scale
=
2
e3
light_init_position
=
[
AU
/
3
,
0
,
0
]
light_init_position
=
[
AU
/
3
,
0
,
0
]
# 创建太阳系天体(忽略质量,引力无效,初速度全部为0)
# 创建太阳系天体(忽略质量,引力无效,初速度全部为0)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录