Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
75523776
宇宙模拟器
项目概览
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看板
提交
75523776
编写于
4月 02, 2024
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
14d1124e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
11 deletion
+17
-11
sim_scenes/featured/center_point_moving_sun_to_earth.py
sim_scenes/featured/center_point_moving_sun_to_earth.py
+15
-10
simulators/ursina/entities/entity_utils.py
simulators/ursina/entities/entity_utils.py
+1
-1
simulators/ursina/ursina_config.py
simulators/ursina/ursina_config.py
+1
-0
未找到文件。
sim_scenes/featured/center_point_moving_sun_to_earth.py
浏览文件 @
75523776
...
...
@@ -92,7 +92,7 @@ class CenterPointMovingSimLive(EarthSeasonsSimBase):
segments
=
100
)
# print(points)
orbit_line
=
create_orbit_by_points
(
center_body
.
position
,
points
,
line_color
=
body
.
trail_color
,
alpha
=
alpha
,
thickness
=
2
)
alpha
=
alpha
,
thickness
=
4
)
return
orbit_line
def
create_orbit_lines
(
self
):
...
...
@@ -109,7 +109,7 @@ class CenterPointMovingSimLive(EarthSeasonsSimBase):
else
:
alpha
=
0.2
start_time
=
conv_to_astropy_time
(
self
.
start_time
)
orbit_line
=
self
.
create_orbit_line
(
self
.
sun
,
body
,
start_time
,
alpha
=
1.0
)
orbit_line
=
self
.
create_orbit_line
(
self
.
sun
,
body
,
start_time
,
alpha
=
0.8
)
if
orbit_line
is
not
None
:
self
.
orbit_lines
.
append
(
orbit_line
)
return
self
.
orbit_lines
...
...
@@ -173,20 +173,25 @@ class CenterPointMovingSimLive(EarthSeasonsSimBase):
def
on_ready
(
self
):
super
(
CenterPointMovingSimLive
,
self
).
on_ready
()
self
.
sky
.
rotation_y
=
20
self
.
sky
.
rotation_x
=
-
290
self
.
sky
.
rotation_z
=
-
95
UrsinaConfig
.
trail_type
=
"line"
# UrsinaConfig.trail_length = 91
UrsinaConfig
.
trail_type
=
"curve_line"
UrsinaConfig
.
trail_length
=
25
0
UrsinaConfig
.
trail_length
=
18
0
# UrsinaConfig.trail_length = 1000
UrsinaConfig
.
trail_thickness_factor
=
2
UrsinaConfig
.
trail_factor
=
2
UrsinaConfig
.
trail_thickness_factor
=
4
UrsinaConfig
.
trail_alpha
=
0.8
UrsinaConfig
.
trail_factor
=
4
for
body
in
self
.
bodies
:
body
.
planet
.
trail_scale
=
2
body
.
planet
.
trail_scale
=
0.5
self
.
moon
.
planet
.
trail_scale
=
1
self
.
moon
.
planet
.
trail_scale
=
0.5
# WorldGrid().draw_axises(10)
# WorldGrid().draw_axises(10
0
)
camera
.
clip_plane_near
=
1
camera
.
look_at
(
Vec3
(
0
,
0
,
0
))
...
...
@@ -248,7 +253,7 @@ class CenterPointMovingSimLive(EarthSeasonsSimBase):
ec
.
world_position
+=
ec
.
right
*
0.8
*
_dt
*
UrsinaConfig
.
run_speed_factor
# 左
d_sun
=
self
.
get_distance_sun
()
# print("d_sun:", d_sun)
if
d_sun
>
4
5
:
if
d_sun
>
4
8
:
self
.
phase_num
=
5
# elif self.phase_num == 5:
# ec.world_position -= ec.back * 1.4* _dt * UrsinaConfig.run_speed_factor # 下
...
...
@@ -327,7 +332,7 @@ if __name__ == '__main__':
"""
sim
=
CenterPointMovingSimLive
()
sim
.
run
(
dt
=
SECONDS_PER_DAY
*
1
0
,
dt
=
SECONDS_PER_DAY
*
1
5
,
# dt=SECONDS_PER_DAY * 3,
init_position
=
[
0
,
-
60
*
AU
,
30
*
AU
],
show_exit_button
=
False
,
...
...
simulators/ursina/entities/entity_utils.py
浏览文件 @
75523776
...
...
@@ -296,7 +296,7 @@ def create_trail_curve_line(parent, pos):
vertices
=
((
pos
[
0
],
pos
[
1
],
pos
[
2
]),
(
trail_last_pos
[
0
],
trail_last_pos
[
1
],
trail_last_pos
[
2
])),
mode
=
'line'
,
thickness
=
UrsinaConfig
.
trail_thickness_factor
),
color
=
parent
.
trail_color
,
alpha
=
0.5
)
color
=
parent
.
trail_color
,
alpha
=
UrsinaConfig
.
trail_alpha
)
trail
.
set_light_off
()
else
:
pass
...
...
simulators/ursina/ursina_config.py
浏览文件 @
75523776
...
...
@@ -17,6 +17,7 @@ class UrsinaConfig:
auto_scale_factor
=
1.0
# __SCALE_FACTOR 不能满足,需要自动进行调整
trail_factor
=
1.0
# 拖尾大小因子。默认为1.0
trail_thickness_factor
=
1.0
# 线条拖尾厚度大小因子。默认为1.0
trail_alpha
=
0.5
# 旋转因子为1,则为正常的转速
ROTATION_SPEED_FACTOR
=
1.0
# ROTATION_SPEED_FACTOR = 0.01
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录