Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
f7186040
宇宙模拟器
项目概览
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看板
提交
f7186040
编写于
12月 19, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
0f2062b6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
7 deletion
+30
-7
sim_scenes/featured/look_at_sky_on_earth.py
sim_scenes/featured/look_at_sky_on_earth.py
+30
-7
未找到文件。
sim_scenes/featured/look_at_sky_on_earth.py
浏览文件 @
f7186040
...
...
@@ -50,7 +50,7 @@ class LookAtSkyOnEarth(UniverseSimScenes):
clouds_texture
=
"transparent.png"
earth_size_scale
=
1
else
:
earth_texture
=
"earth_miller_projection_sw.png"
# "earth_miller_projection_SW.jpg"
earth_texture
=
"earth_miller_projection_sw
_trans.png"
# "earth_miller_projection_sw
.png" # "earth_miller_projection_SW.jpg"
clouds_texture
=
"transparent_clouds.png"
earth_size_scale
=
6e3
# 运动的地球
...
...
@@ -81,7 +81,7 @@ class LookAtSkyOnEarth(UniverseSimScenes):
self
.
earth
.
init_velocity
=
pos_vel
[
"vel"
]
self
.
bodies
=
[
self
.
sun
,
self
.
earth
#
, self.earth_clouds
self
.
sun
,
self
.
earth
#
, self.earth_clouds
]
if
self
.
show_china
:
...
...
@@ -92,13 +92,36 @@ class LookAtSkyOnEarth(UniverseSimScenes):
# 中国农历24节气表,数据为 节气名称 和 camera.rotation_y 的角度范围值
self
.
solar_terms_angles
=
get_solar_terms_angles
()
def
create_sky_watchers
(
self
):
from
simulators.ursina.ursina_mesh
import
create_sphere
from
ursina
import
Entity
,
color
r
=
0.5
y
=
0.4
x
=
-
0.26
watcher_e
=
Entity
(
parent
=
self
.
earth
.
planet
,
model
=
create_sphere
(
r
,
32
),
scale
=
0.05
,
y
=
0.0
,
x
=
x
-
0.17
,
z
=
pow
(
pow
(
r
,
2
)
-
pow
(
x
-
0.17
,
2
),
0.5
),
color
=
color
.
green
)
watcher_n
=
Entity
(
parent
=
self
.
earth
.
planet
,
model
=
create_sphere
(
r
,
32
),
scale
=
0.05
,
y
=
y
,
x
=
x
,
z
=
pow
(
pow
(
r
,
2
)
-
pow
(
x
,
2
)
-
pow
(
y
,
2
),
0.5
),
color
=
color
.
red
)
watcher_s
=
Entity
(
parent
=
self
.
earth
.
planet
,
model
=
create_sphere
(
r
,
32
),
scale
=
0.05
,
y
=-
y
,
x
=
x
,
z
=
pow
(
pow
(
r
,
2
)
-
pow
(
x
,
2
)
-
pow
(
y
,
2
),
0.5
),
color
=
color
.
blue
)
def
on_ready
(
self
):
self
.
earth
.
planet
.
rotation_y
-=
180
# 一开始就正对太阳
self
.
earth
.
planet
.
alpha
=
0.9
# self.earth.planet.alpha = 0.2
# self.earth_cn.planet.rotation_y -= 185 # 一开始就正对太阳
if
hasattr
(
self
.
earth_clouds
,
"planet"
):
self
.
earth_clouds
.
planet
.
rotation_y
-=
50
# 一开始就正对太阳
self
.
earth
.
planet
.
init_rotation_y
=
self
.
earth
.
planet
.
rotation_y
if
self
.
show_name
:
font
=
find_file
(
"fonts/DroidSansFallback.ttf"
,
UrsinaConfig
.
CN_FONT
)
from
ursina
import
color
...
...
@@ -112,8 +135,6 @@ class LookAtSkyOnEarth(UniverseSimScenes):
if
hasattr
(
self
.
earth_clouds
,
"name_text"
):
self
.
earth_clouds
.
name_text
.
enabled
=
False
if
self
.
show_china
:
if
hasattr
(
self
.
earth_cn
,
"name_text"
):
self
.
earth_cn
.
name_text
.
enabled
=
False
...
...
@@ -170,7 +191,6 @@ class LookAtSkyOnEarth(UniverseSimScenes):
camera
.
clip_plane_near
=
10
camera
.
clip_plane_far
=
1000000
def
delay_app_start
():
import
time
# time.sleep(8.0 / self.speed_factor)
...
...
@@ -185,8 +205,11 @@ class LookAtSkyOnEarth(UniverseSimScenes):
# self.sun.planet.glow_circle.look_at(camera)
create_foreground
(
f
"armazonesdusk_
{
self
.
look_point
+
2
}
.png"
)
self
.
create_sky_watchers
()
def
on_timer_changed
(
self
,
time_data
:
TimeData
):
pass
if
abs
(
self
.
earth
.
planet
.
init_rotation_y
-
self
.
earth
.
planet
.
rotation_y
)
>
365
:
exit
(
0
)
# if self.show_china and self.wait_days_count > 0:
# self.wait_days_count = self.wait_days - time_data.total_days
#
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录