Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
a39aa76d
宇宙模拟器
项目概览
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看板
提交
a39aa76d
编写于
10月 09, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
faf489ba
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
35 addition
and
4 deletion
+35
-4
sim_scenes/earth/earth_clouds.py
sim_scenes/earth/earth_clouds.py
+15
-1
sim_scenes/func.py
sim_scenes/func.py
+3
-1
sim_scenes/tri_bodies/tri_bodies_04.py
sim_scenes/tri_bodies/tri_bodies_04.py
+17
-2
未找到文件。
sim_scenes/earth/earth_clouds.py
浏览文件 @
a39aa76d
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
# ==============================================================================
# ==============================================================================
from
bodies
import
Earth
from
bodies
import
Earth
from
common.consts
import
SECONDS_PER_HOUR
,
SECONDS_PER_DAY
from
common.consts
import
SECONDS_PER_HOUR
,
SECONDS_PER_DAY
from
sim_scenes.func
import
ursina_run
from
sim_scenes.func
import
ursina_run
,
create_sphere_sky
from
simulators.ursina.ursina_event
import
UrsinaEvent
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
"""
"""
...
@@ -29,10 +30,23 @@ if __name__ == '__main__':
...
@@ -29,10 +30,23 @@ if __name__ == '__main__':
bodies
=
[
earth
,
earth_with_clouds
,
clouds
]
bodies
=
[
earth
,
earth_with_clouds
,
clouds
]
def
on_ready
():
from
ursina
import
camera
# camera.fov = 30
# 运行前触发
create_sphere_sky
(
scale
=
10000
).
rotation_y
=
220
# 订阅事件后,上面的函数功能才会起作用
# 运行前会触发 on_ready
UrsinaEvent
.
on_ready_subscription
(
on_ready
)
# 使用 ursina 查看的运行效果
# 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# position = 左-右+、上+下-、前+后-
# position = 左-右+、上+下-、前+后-
ursina_run
(
bodies
,
SECONDS_PER_HOUR
/
2
,
ursina_run
(
bodies
,
SECONDS_PER_HOUR
/
2
,
position
=
(
1.5
*
earth
.
radius
,
0
,
-
30000
),
position
=
(
1.5
*
earth
.
radius
,
0
,
-
30000
),
show_grid
=
False
,
show_grid
=
False
,
cosmic_bg
=
''
,
show_camera_info
=
False
,
show_control_info
=
False
,
view_closely
=
0.001
)
# 近距离观看 view_closely=True或0.001
view_closely
=
0.001
)
# 近距离观看 view_closely=True或0.001
sim_scenes/func.py
浏览文件 @
a39aa76d
...
@@ -668,7 +668,9 @@ def create_sphere_sky(texture="bg_pan.jpg", scale=8000):
...
@@ -668,7 +668,9 @@ def create_sphere_sky(texture="bg_pan.jpg", scale=8000):
from
simulators.ursina.entities.sphere_sky
import
SphereSky
from
simulators.ursina.entities.sphere_sky
import
SphereSky
sky_texture
=
find_texture
(
texture
,
None
)
sky_texture
=
find_texture
(
texture
,
None
)
if
sky_texture
is
not
None
:
if
sky_texture
is
not
None
:
SphereSky
(
texture
=
sky_texture
).
scale
=
scale
sky
=
SphereSky
(
texture
=
sky_texture
)
sky
.
scale
=
scale
return
sky
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
sim_scenes/tri_bodies/tri_bodies_04.py
浏览文件 @
a39aa76d
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
# ==============================================================================
# ==============================================================================
from
bodies
import
Sun
,
Earth
from
bodies
import
Sun
,
Earth
from
common.consts
import
SECONDS_PER_DAY
,
SECONDS_PER_WEEK
,
SECONDS_PER_YEAR
,
AU
from
common.consts
import
SECONDS_PER_DAY
,
SECONDS_PER_WEEK
,
SECONDS_PER_YEAR
,
AU
from
sim_scenes.func
import
mayavi_run
,
mpl_run
,
ursina_run
from
sim_scenes.func
import
mayavi_run
,
mpl_run
,
ursina_run
,
create_sphere_sky
from
simulators.ursina.ursina_event
import
UrsinaEvent
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
"""
"""
...
@@ -37,7 +38,21 @@ if __name__ == '__main__':
...
@@ -37,7 +38,21 @@ if __name__ == '__main__':
size_scale
=
SIZE_SCALE
,
texture
=
"fixed_star.png"
),
size_scale
=
SIZE_SCALE
,
texture
=
"fixed_star.png"
),
]
]
def
on_ready
():
from
ursina
import
camera
# camera.fov = 30
# 运行前触发
create_sphere_sky
(
scale
=
10000
)
# 订阅事件后,上面的函数功能才会起作用
# 运行前会触发 on_ready
UrsinaEvent
.
on_ready_subscription
(
on_ready
)
# 使用 ursina 查看的运行效果
# 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# position = 左-右+、上+下-、前+后-
# position = 左-右+、上+下-、前+后-
ursina_run
(
bodies
,
SECONDS_PER_WEEK
,
position
=
(
0
*
AU
,
0
,
-
3
*
AU
),
show_trail
=
True
)
ursina_run
(
bodies
,
SECONDS_PER_WEEK
*
2
,
position
=
(
0
*
AU
,
0
,
-
3
*
AU
),
cosmic_bg
=
''
,
show_grid
=
False
,
show_trail
=
True
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录