Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
ef6e4c8e
宇宙模拟器
项目概览
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看板
提交
ef6e4c8e
编写于
12月 17, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
b35e0d2c
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
11 addition
and
10 deletion
+11
-10
sim_scenes/featured/earth_seasons_1.py
sim_scenes/featured/earth_seasons_1.py
+2
-2
sim_scenes/featured/earth_seasons_2.py
sim_scenes/featured/earth_seasons_2.py
+2
-2
sim_scenes/featured/earth_seasons_3.py
sim_scenes/featured/earth_seasons_3.py
+3
-3
sim_scenes/featured/earth_seasons_base.py
sim_scenes/featured/earth_seasons_base.py
+4
-3
未找到文件。
sim_scenes/featured/earth_seasons_1.py
浏览文件 @
ef6e4c8e
...
@@ -19,7 +19,7 @@ class EarthSeasonsSim(EarthSeasonsSimBase):
...
@@ -19,7 +19,7 @@ class EarthSeasonsSim(EarthSeasonsSimBase):
super
(
EarthSeasonsSim
,
self
).
__init__
(
sun_transparent
=
False
,
super
(
EarthSeasonsSim
,
self
).
__init__
(
sun_transparent
=
False
,
show_sphere_sky
=
False
,
show_sphere_sky
=
False
,
look_at_earth
=
False
,
look_at_earth
=
False
,
exit_at_total_days
=
400
,
#
exit_at_total_days=400,
earth_cn_size_factor
=
1.01
,
earth_cn_size_factor
=
1.01
,
show_name
=
False
)
show_name
=
False
)
...
@@ -33,4 +33,4 @@ if __name__ == '__main__':
...
@@ -33,4 +33,4 @@ if __name__ == '__main__':
摄像机以侧视图(秋分侧)看太阳和地球(四季和24节气)
摄像机以侧视图(秋分侧)看太阳和地球(四季和24节气)
"""
"""
sim
=
EarthSeasonsSim
()
sim
=
EarthSeasonsSim
()
sim
.
run
(
(
3
*
AU
,
AU
,
0
)
)
sim
.
run
(
init_position
=
(
3
*
AU
,
AU
,
0
),
speed_factor
=
10.0
)
sim_scenes/featured/earth_seasons_2.py
浏览文件 @
ef6e4c8e
...
@@ -19,7 +19,7 @@ class EarthSeasonsSim(EarthSeasonsSimBase):
...
@@ -19,7 +19,7 @@ class EarthSeasonsSim(EarthSeasonsSimBase):
super
(
EarthSeasonsSim
,
self
).
__init__
(
sun_transparent
=
False
,
super
(
EarthSeasonsSim
,
self
).
__init__
(
sun_transparent
=
False
,
show_sphere_sky
=
False
,
show_sphere_sky
=
False
,
look_at_earth
=
False
,
look_at_earth
=
False
,
exit_at_total_days
=
400
,
#
exit_at_total_days=400,
earth_cn_size_factor
=
1.01
,
earth_cn_size_factor
=
1.01
,
show_name
=
False
)
show_name
=
False
)
...
@@ -33,4 +33,4 @@ if __name__ == '__main__':
...
@@ -33,4 +33,4 @@ if __name__ == '__main__':
摄像机以侧视图(夏至侧)看太阳和地球(四季和24节气)
摄像机以侧视图(夏至侧)看太阳和地球(四季和24节气)
"""
"""
sim
=
EarthSeasonsSim
()
sim
=
EarthSeasonsSim
()
sim
.
run
(
(
0
,
AU
,
-
3
*
AU
)
)
sim
.
run
(
init_position
=
(
0
,
AU
,
-
3
*
AU
),
speed_factor
=
10.0
)
sim_scenes/featured/earth_seasons_3.py
浏览文件 @
ef6e4c8e
...
@@ -13,13 +13,13 @@ from sim_scenes.func import camera_look_at
...
@@ -13,13 +13,13 @@ from sim_scenes.func import camera_look_at
class
EarthSeasonsSim
(
EarthSeasonsSimBase
):
class
EarthSeasonsSim
(
EarthSeasonsSimBase
):
window_size
=
(
1920
/
3
,
1080
/
3
)
window_size
=
(
1920
/
2
,
1080
/
2
)
def
__init__
(
self
):
def
__init__
(
self
):
super
(
EarthSeasonsSim
,
self
).
__init__
(
sun_transparent
=
False
,
super
(
EarthSeasonsSim
,
self
).
__init__
(
sun_transparent
=
False
,
show_sphere_sky
=
False
,
show_sphere_sky
=
False
,
look_at_earth
=
False
,
look_at_earth
=
False
,
exit_at_total_days
=
400
,
#
exit_at_total_days=400,
earth_cn_size_factor
=
1.01
,
earth_cn_size_factor
=
1.01
,
show_name
=
False
)
show_name
=
False
)
...
@@ -33,4 +33,4 @@ if __name__ == '__main__':
...
@@ -33,4 +33,4 @@ if __name__ == '__main__':
摄像机以俯视图看太阳和地球(四季和24节气)
摄像机以俯视图看太阳和地球(四季和24节气)
"""
"""
sim
=
EarthSeasonsSim
()
sim
=
EarthSeasonsSim
()
sim
.
run
(
(
0
,
4
*
AU
,
0
)
)
sim
.
run
(
init_position
=
(
0
,
4
*
AU
,
0
),
speed_factor
=
10.0
)
sim_scenes/featured/earth_seasons_base.py
浏览文件 @
ef6e4c8e
...
@@ -152,7 +152,7 @@ class EarthSeasonsSimBase(UniverseSimScenes):
...
@@ -152,7 +152,7 @@ class EarthSeasonsSimBase(UniverseSimScenes):
from
ursina
import
application
,
invoke
from
ursina
import
application
,
invoke
def
delay_app_start
():
def
delay_app_start
():
import
time
import
time
time
.
sleep
(
8.0
)
time
.
sleep
(
8.0
/
self
.
speed_factor
)
self
.
wait_days_count
=
0
self
.
wait_days_count
=
0
application
.
paused
=
False
application
.
paused
=
False
...
@@ -199,7 +199,8 @@ class EarthSeasonsSimBase(UniverseSimScenes):
...
@@ -199,7 +199,8 @@ class EarthSeasonsSimBase(UniverseSimScenes):
# print(camera.rotation_y)
# print(camera.rotation_y)
def
run
(
self
,
init_position
=
(
0
,
0
,
0
)):
def
run
(
self
,
init_position
=
(
0
,
0
,
0
),
speed_factor
=
1.0
):
self
.
speed_factor
=
speed_factor
# 订阅事件后,上面2个函数功能才会起作用
# 订阅事件后,上面2个函数功能才会起作用
# 运行前会触发 on_ready
# 运行前会触发 on_ready
UrsinaEvent
.
on_ready_subscription
(
self
.
on_ready
)
UrsinaEvent
.
on_ready_subscription
(
self
.
on_ready
)
...
@@ -210,7 +211,7 @@ class EarthSeasonsSimBase(UniverseSimScenes):
...
@@ -210,7 +211,7 @@ class EarthSeasonsSimBase(UniverseSimScenes):
# 使用 ursina 查看的运行效果
# 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# position = 左-右+、上+下-、前+后-
# position = 左-右+、上+下-、前+后-
ursina_run
(
self
.
bodies
,
SECONDS_PER_DAY
,
ursina_run
(
self
.
bodies
,
SECONDS_PER_DAY
*
speed_factor
,
position
=
init_position
,
# 摄像机和太阳是相同位置
position
=
init_position
,
# 摄像机和太阳是相同位置
show_name
=
self
.
show_name
,
show_name
=
self
.
show_name
,
show_grid
=
False
,
show_grid
=
False
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录