Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
6e93d22c
宇宙模拟器
项目概览
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看板
提交
6e93d22c
编写于
11月 17, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
50d20da6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
9 addition
and
3 deletion
+9
-3
bodies/sun.py
bodies/sun.py
+4
-1
sim_scenes/solar_system/halley_comet_lib.py
sim_scenes/solar_system/halley_comet_lib.py
+1
-1
sim_scenes/solar_system/halley_comet_sim.py
sim_scenes/solar_system/halley_comet_sim.py
+4
-1
textures/fixed_star_light.png
textures/fixed_star_light.png
+0
-0
textures/sun_light.jpg
textures/sun_light.jpg
+0
-0
未找到文件。
bodies/sun.py
浏览文件 @
6e93d22c
...
@@ -22,7 +22,9 @@ class Sun(FixedStar):
...
@@ -22,7 +22,9 @@ class Sun(FixedStar):
init_position
=
[
0
,
0
,
0
],
init_position
=
[
0
,
0
,
0
],
init_velocity
=
[
0
,
0
,
0
],
init_velocity
=
[
0
,
0
,
0
],
color
=
(
170
,
98
,
25
),
color
=
(
170
,
98
,
25
),
texture
=
"sun2.jpg"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
# texture="sun2.jpg",
texture
=
"sun2.jpg"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.6130
,
ignore_mass
=
False
,
rotation_speed
=
0.6130
,
ignore_mass
=
False
,
show_trail
=
True
,
trail_color
=
None
,
show_name
=
False
):
show_trail
=
True
,
trail_color
=
None
,
show_name
=
False
):
params
=
{
params
=
{
...
@@ -43,6 +45,7 @@ class Sun(FixedStar):
...
@@ -43,6 +45,7 @@ class Sun(FixedStar):
}
}
super
().
__init__
(
**
params
)
super
().
__init__
(
**
params
)
self
.
glows
=
(
12
,
1.015
,
0.08
)
self
.
glows
=
(
12
,
1.015
,
0.08
)
self
.
glows
=
(
4
,
1.005
,
0.1
)
@
property
@
property
def
is_fixed_star
(
self
):
def
is_fixed_star
(
self
):
...
...
sim_scenes/solar_system/halley_comet_lib.py
浏览文件 @
6e93d22c
...
@@ -90,7 +90,7 @@ class HalleyCometSimBase(UniverseSimScenes):
...
@@ -90,7 +90,7 @@ class HalleyCometSimBase(UniverseSimScenes):
def
build_solar_system
(
self
,
ignore_gravity
=
False
,
start_time
=
None
):
def
build_solar_system
(
self
,
ignore_gravity
=
False
,
start_time
=
None
):
# region 构建太阳系
# region 构建太阳系
show_trail
=
False
show_trail
=
False
self
.
sun
=
Sun
(
size_scale
=
0.6e2
,
show_trail
=
show_trail
)
self
.
sun
=
Sun
(
size_scale
=
0.6e2
,
show_trail
=
show_trail
,
texture
=
"sun_light.jpg"
)
self
.
mercury
=
Mercury
(
size_scale
=
5e3
,
show_trail
=
show_trail
)
self
.
mercury
=
Mercury
(
size_scale
=
5e3
,
show_trail
=
show_trail
)
self
.
venus
=
Venus
(
size_scale
=
3e3
,
show_trail
=
show_trail
)
self
.
venus
=
Venus
(
size_scale
=
3e3
,
show_trail
=
show_trail
)
self
.
earth
=
Earth
(
size_scale
=
3e3
,
rotate_angle
=
0
,
show_trail
=
show_trail
)
self
.
earth
=
Earth
(
size_scale
=
3e3
,
rotate_angle
=
0
,
show_trail
=
show_trail
)
...
...
sim_scenes/solar_system/halley_comet_sim.py
浏览文件 @
6e93d22c
...
@@ -57,7 +57,7 @@ class HalleyCometSim(HalleyCometSimBase):
...
@@ -57,7 +57,7 @@ class HalleyCometSim(HalleyCometSimBase):
@return:
@return:
"""
"""
self
.
build_solar_system
(
ignore_gravity
=
True
,
start_time
=
self
.
start_time
)
self
.
build_solar_system
(
ignore_gravity
=
True
,
start_time
=
self
.
start_time
)
self
.
sun
.
glows
=
(
80
,
1.005
,
0.01
)
self
.
sun
.
glows
=
(
2
,
1.005
,
0.01
)
# 创建哈雷彗星创建哈雷彗星
# 创建哈雷彗星创建哈雷彗星
self
.
halley_comet
=
create_halley_comet
(
self
.
params
.
init_velocity
,
self
.
params
.
init_position
)
self
.
halley_comet
=
create_halley_comet
(
self
.
params
.
init_velocity
,
self
.
params
.
init_position
)
...
@@ -75,6 +75,7 @@ class HalleyCometSim(HalleyCometSimBase):
...
@@ -75,6 +75,7 @@ class HalleyCometSim(HalleyCometSimBase):
初始化设置
初始化设置
@return:
@return:
"""
"""
from
ursina
import
color
# 创建天空
# 创建天空
create_sphere_sky
(
scale
=
50000
)
create_sphere_sky
(
scale
=
50000
)
# UrsinaConfig.trail_type = "curve_line"
# UrsinaConfig.trail_type = "curve_line"
...
@@ -91,6 +92,8 @@ class HalleyCometSim(HalleyCometSimBase):
...
@@ -91,6 +92,8 @@ class HalleyCometSim(HalleyCometSimBase):
camera
.
clip_plane_far
=
51000
camera
.
clip_plane_far
=
51000
# camera.fov = 60
# camera.fov = 60
# self.sun.planet.color = color.white
# application.time_scale = 0.01
# application.time_scale = 0.01
# 摄像机移动 update
# 摄像机移动 update
# camera_move_update()
# camera_move_update()
...
...
textures/fixed_star_light.png
0 → 100644
浏览文件 @
6e93d22c
338.1 KB
textures/sun_light.jpg
0 → 100644
浏览文件 @
6e93d22c
649.1 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录