Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
太阳系三体模拟器
提交
a4c6f272
太阳系三体模拟器
项目概览
Python_超人
/
太阳系三体模拟器
通知
1073
Star
131
Fork
128
代码
文件
提交
分支
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看板
提交
a4c6f272
编写于
3月 22, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
太阳系三体模拟器
上级
ab279f2b
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
68 addition
and
47 deletion
+68
-47
bodies/earth.py
bodies/earth.py
+4
-2
bodies/fixed_stars/alcyone.py
bodies/fixed_stars/alcyone.py
+1
-1
bodies/fixed_stars/aldebaran.py
bodies/fixed_stars/aldebaran.py
+1
-1
bodies/fixed_stars/antares.py
bodies/fixed_stars/antares.py
+1
-1
bodies/fixed_stars/arcturus.py
bodies/fixed_stars/arcturus.py
+1
-1
bodies/fixed_stars/bellatrix.py
bodies/fixed_stars/bellatrix.py
+1
-1
bodies/fixed_stars/betelgeuse.py
bodies/fixed_stars/betelgeuse.py
+1
-1
bodies/fixed_stars/carinae_v382.py
bodies/fixed_stars/carinae_v382.py
+1
-1
bodies/fixed_stars/eta_carinae.py
bodies/fixed_stars/eta_carinae.py
+1
-1
bodies/fixed_stars/fixed_star.py
bodies/fixed_stars/fixed_star.py
+1
-1
bodies/fixed_stars/rigel.py
bodies/fixed_stars/rigel.py
+1
-1
bodies/fixed_stars/sirius.py
bodies/fixed_stars/sirius.py
+1
-1
bodies/fixed_stars/stephenson_2_18.py
bodies/fixed_stars/stephenson_2_18.py
+1
-1
bodies/fixed_stars/uy_scuti.py
bodies/fixed_stars/uy_scuti.py
+1
-1
bodies/fixed_stars/vy_canis_majoris.py
bodies/fixed_stars/vy_canis_majoris.py
+1
-1
bodies/fixed_stars/y_canum_venaticorum.py
bodies/fixed_stars/y_canum_venaticorum.py
+1
-1
bodies/jupiter.py
bodies/jupiter.py
+4
-2
bodies/mars.py
bodies/mars.py
+4
-2
bodies/mercury.py
bodies/mercury.py
+4
-2
bodies/moon.py
bodies/moon.py
+4
-2
bodies/neptune.py
bodies/neptune.py
+4
-2
bodies/pluto.py
bodies/pluto.py
+4
-2
bodies/saturn.py
bodies/saturn.py
+4
-2
bodies/uranus.py
bodies/uranus.py
+4
-2
bodies/venus.py
bodies/venus.py
+4
-2
scenes/fixed_stars.py
scenes/fixed_stars.py
+13
-12
未找到文件。
bodies/earth.py
浏览文件 @
a4c6f272
...
...
@@ -27,7 +27,7 @@ class Earth(Body):
init_position
=
[
1.12
*
AU
,
0
,
0
],
init_velocity
=
[
0
,
29.79
,
0
],
texture
=
"earth1.jpg"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
15
):
rotation_speed
=
15
,
ignore_mass
=
False
,
trail_color
=
None
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
@@ -38,7 +38,9 @@ class Earth(Body):
"texture"
:
texture
,
"size_scale"
:
size_scale
,
"distance_scale"
:
distance_scale
,
"rotation_speed"
:
rotation_speed
"rotation_speed"
:
rotation_speed
,
"ignore_mass"
:
ignore_mass
,
"trail_color"
:
trail_color
}
super
().
__init__
(
**
params
)
...
...
bodies/fixed_stars/alcyone.py
浏览文件 @
a4c6f272
...
...
@@ -41,7 +41,7 @@ class Alcyone(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
0xBB
,
0xAA
,
0xFF
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
45
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/aldebaran.py
浏览文件 @
a4c6f272
...
...
@@ -44,7 +44,7 @@ class Aldebaran(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
250
,
195
,
47
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
35
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/antares.py
浏览文件 @
a4c6f272
...
...
@@ -50,7 +50,7 @@ class Antares(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
249
,
198
,
83
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
25
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/arcturus.py
浏览文件 @
a4c6f272
...
...
@@ -46,7 +46,7 @@ class Arcturus(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
254
,
218
,
185
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
4
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/bellatrix.py
浏览文件 @
a4c6f272
...
...
@@ -51,7 +51,7 @@ class Bellatrix(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
122
,
187
,
255
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
5
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/betelgeuse.py
浏览文件 @
a4c6f272
...
...
@@ -42,7 +42,7 @@ class Betelgeuse(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
254
,
162
,
1
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
24
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/carinae_v382.py
浏览文件 @
a4c6f272
...
...
@@ -35,7 +35,7 @@ class CarinaeV382(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
255
,
244
,
89
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
26
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/eta_carinae.py
浏览文件 @
a4c6f272
...
...
@@ -37,7 +37,7 @@ class EtaCarinae(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
111
,
140
,
255
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
28
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/fixed_star.py
浏览文件 @
a4c6f272
...
...
@@ -49,7 +49,7 @@ class FixedStar(Body):
}
super
().
__init__
(
**
params
)
self
.
light_on
=
True
self
.
glows
=
10
self
.
glows
=
(
12
,
1.005
,
0.08
)
def
gen_texture
(
self
,
texture
,
texture_bright
,
texture_contrast
):
if
texture
is
None
:
...
...
bodies/fixed_stars/rigel.py
浏览文件 @
a4c6f272
...
...
@@ -41,7 +41,7 @@ class Rigel(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
141
,
213
,
227
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
33
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/sirius.py
浏览文件 @
a4c6f272
...
...
@@ -54,7 +54,7 @@ class Sirius(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
0xFF
,
0xFF
,
0xFF
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
55
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/stephenson_2_18.py
浏览文件 @
a4c6f272
...
...
@@ -50,7 +50,7 @@ class Stephenson_2_18(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
198
,
29
,
3
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
2
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/uy_scuti.py
浏览文件 @
a4c6f272
...
...
@@ -36,7 +36,7 @@ class UYScuti(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
255
,
116
,
0
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
22
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/vy_canis_majoris.py
浏览文件 @
a4c6f272
...
...
@@ -50,7 +50,7 @@ class VYCanisMajoris(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
234
,
90
,
65
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
23
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/fixed_stars/y_canum_venaticorum.py
浏览文件 @
a4c6f272
...
...
@@ -31,7 +31,7 @@ class YCanumVenaticorum(FixedStar):
init_velocity
=
[
0
,
0
,
0
],
color
=
(
255
,
55
,
18
),
texture
=
"fixed_star.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.
1
,
ignore_mass
=
False
):
rotation_speed
=
0.
3
,
ignore_mass
=
False
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
bodies/jupiter.py
浏览文件 @
a4c6f272
...
...
@@ -27,7 +27,7 @@ class Jupiter(Body):
init_position
=
[
5.2
*
AU
,
0
,
0
],
init_velocity
=
[
0
,
13.06
,
0
],
texture
=
"jupiter1.jpg"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
36.2537
):
rotation_speed
=
36.2537
,
ignore_mass
=
False
,
trail_color
=
None
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
@@ -38,7 +38,9 @@ class Jupiter(Body):
"texture"
:
texture
,
"size_scale"
:
size_scale
,
"distance_scale"
:
distance_scale
,
"rotation_speed"
:
rotation_speed
"rotation_speed"
:
rotation_speed
,
"ignore_mass"
:
ignore_mass
,
"trail_color"
:
trail_color
}
super
().
__init__
(
**
params
)
...
...
bodies/mars.py
浏览文件 @
a4c6f272
...
...
@@ -26,7 +26,7 @@ class Mars(Body):
init_position
=
[
1.5
*
AU
,
0
,
0
],
init_velocity
=
[
0
,
24.13
,
0
],
texture
=
"mars.jpg"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
14.6223
):
rotation_speed
=
14.6223
,
ignore_mass
=
False
,
trail_color
=
None
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
@@ -37,7 +37,9 @@ class Mars(Body):
"texture"
:
texture
,
"size_scale"
:
size_scale
,
"distance_scale"
:
distance_scale
,
"rotation_speed"
:
rotation_speed
"rotation_speed"
:
rotation_speed
,
"ignore_mass"
:
ignore_mass
,
"trail_color"
:
trail_color
}
super
().
__init__
(
**
params
)
...
...
bodies/mercury.py
浏览文件 @
a4c6f272
...
...
@@ -27,7 +27,7 @@ class Mercury(Body):
init_position
=
[
0.4
*
AU
,
0
,
0
],
init_velocity
=
[
0
,
47.87
,
0
],
texture
=
"mercury.jpg"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.2558
):
rotation_speed
=
0.2558
,
ignore_mass
=
False
,
trail_color
=
None
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
@@ -38,7 +38,9 @@ class Mercury(Body):
"texture"
:
texture
,
"size_scale"
:
size_scale
,
"distance_scale"
:
distance_scale
,
"rotation_speed"
:
rotation_speed
"rotation_speed"
:
rotation_speed
,
"ignore_mass"
:
ignore_mass
,
"trail_color"
:
trail_color
}
super
().
__init__
(
**
params
)
...
...
bodies/moon.py
浏览文件 @
a4c6f272
...
...
@@ -26,7 +26,7 @@ class Moon(Body):
init_position
=
[
363104
+
1.12
*
AU
,
0
,
0
],
init_velocity
=
[
0
,
29.79
+
1.023
,
0
],
texture
=
"moon.jpg"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
0.5487
):
rotation_speed
=
0.5487
,
ignore_mass
=
False
,
trail_color
=
None
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
@@ -37,7 +37,9 @@ class Moon(Body):
"texture"
:
texture
,
"size_scale"
:
size_scale
,
"distance_scale"
:
distance_scale
,
"rotation_speed"
:
rotation_speed
"rotation_speed"
:
rotation_speed
,
"ignore_mass"
:
ignore_mass
,
"trail_color"
:
trail_color
}
super
().
__init__
(
**
params
)
...
...
bodies/neptune.py
浏览文件 @
a4c6f272
...
...
@@ -27,7 +27,7 @@ class Neptune(Body):
init_position
=
[
30
*
AU
,
0
,
0
],
init_velocity
=
[
0
,
5.43
,
0
],
texture
=
"neptune.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
22.3463
):
rotation_speed
=
22.3463
,
ignore_mass
=
False
,
trail_color
=
None
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
@@ -38,7 +38,9 @@ class Neptune(Body):
"texture"
:
texture
,
"size_scale"
:
size_scale
,
"distance_scale"
:
distance_scale
,
"rotation_speed"
:
rotation_speed
"rotation_speed"
:
rotation_speed
,
"ignore_mass"
:
ignore_mass
,
"trail_color"
:
trail_color
}
super
().
__init__
(
**
params
)
...
...
bodies/pluto.py
浏览文件 @
a4c6f272
...
...
@@ -27,7 +27,7 @@ class Pluto(Body):
init_position
=
[
40
*
AU
,
0
,
0
],
init_velocity
=
[
0
,
4.7
,
0
],
texture
=
"pluto.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=-
2.3474
):
rotation_speed
=-
2.3474
,
ignore_mass
=
False
,
trail_color
=
None
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
@@ -38,7 +38,9 @@ class Pluto(Body):
"texture"
:
texture
,
"size_scale"
:
size_scale
,
"distance_scale"
:
distance_scale
,
"rotation_speed"
:
rotation_speed
"rotation_speed"
:
rotation_speed
,
"ignore_mass"
:
ignore_mass
,
"trail_color"
:
trail_color
}
super
().
__init__
(
**
params
)
...
...
bodies/saturn.py
浏览文件 @
a4c6f272
...
...
@@ -27,7 +27,7 @@ class Saturn(Body):
init_position
=
[
10
*
AU
,
0
,
0
],
init_velocity
=
[
0
,
9.64
,
0
],
texture
=
"saturn.jpg"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=
33.7711
):
rotation_speed
=
33.7711
,
ignore_mass
=
False
,
trail_color
=
None
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
@@ -38,7 +38,9 @@ class Saturn(Body):
"texture"
:
texture
,
"size_scale"
:
size_scale
,
"distance_scale"
:
distance_scale
,
"rotation_speed"
:
rotation_speed
"rotation_speed"
:
rotation_speed
,
"ignore_mass"
:
ignore_mass
,
"trail_color"
:
trail_color
}
super
().
__init__
(
**
params
)
...
...
bodies/uranus.py
浏览文件 @
a4c6f272
...
...
@@ -27,7 +27,7 @@ class Uranus(Body):
init_position
=
[
19
*
AU
,
0
,
0
],
init_velocity
=
[
0
,
6.81
,
0
],
texture
=
"uranus.png"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=-
20.8816
):
rotation_speed
=-
20.8816
,
ignore_mass
=
False
,
trail_color
=
None
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
@@ -38,7 +38,9 @@ class Uranus(Body):
"texture"
:
texture
,
"size_scale"
:
size_scale
,
"distance_scale"
:
distance_scale
,
"rotation_speed"
:
rotation_speed
"rotation_speed"
:
rotation_speed
,
"ignore_mass"
:
ignore_mass
,
"trail_color"
:
trail_color
}
super
().
__init__
(
**
params
)
...
...
bodies/venus.py
浏览文件 @
a4c6f272
...
...
@@ -27,7 +27,7 @@ class Venus(Body):
init_position
=
[
0.72
*
AU
,
0
,
0
],
init_velocity
=
[
0
,
35
,
0
],
texture
=
"venus.jpg"
,
size_scale
=
1.0
,
distance_scale
=
1.0
,
rotation_speed
=-
0.0617
):
rotation_speed
=-
0.0617
,
ignore_mass
=
False
,
trail_color
=
None
):
params
=
{
"name"
:
name
,
"mass"
:
mass
,
...
...
@@ -38,7 +38,9 @@ class Venus(Body):
"texture"
:
texture
,
"size_scale"
:
size_scale
,
"distance_scale"
:
distance_scale
,
"rotation_speed"
:
rotation_speed
"rotation_speed"
:
rotation_speed
,
"ignore_mass"
:
ignore_mass
,
"trail_color"
:
trail_color
}
super
().
__init__
(
**
params
)
...
...
scenes/fixed_stars.py
浏览文件 @
a4c6f272
...
...
@@ -18,10 +18,10 @@ if __name__ == '__main__':
"""
# 构建两个天体对象(太阳、地球)
D
=
5e5
SIZE_SCALE
=
0.
02
SIZE_SCALE
=
0.
5
bodies
=
[
Earth
(
size_scale
=
1
,
init_velocity
=
[
0
,
29.79
,
0
],
distance_scale
=
0.0006
),
Sun
(
size_scale
=
SIZE_SCALE
),
# 太阳
Earth
(
size_scale
=
SIZE_SCALE
,
ignore_mass
=
True
),
Sun
(
size_scale
=
SIZE_SCALE
,
ignore_mass
=
True
),
# 太阳
Sirius
(
size_scale
=
SIZE_SCALE
,
ignore_mass
=
True
),
# 天狼星A 质量倍数 2.06 半径倍数 1.71
Bellatrix
(
size_scale
=
SIZE_SCALE
,
ignore_mass
=
True
),
# 参宿五 质量倍数 8.6 半径倍数 5.75
Alcyone
(
size_scale
=
SIZE_SCALE
,
ignore_mass
=
True
),
# 昴宿六 质量倍数 7 半径倍数 10
...
...
@@ -31,9 +31,6 @@ if __name__ == '__main__':
YCanumVenaticorum
(
size_scale
=
SIZE_SCALE
,
ignore_mass
=
True
),
# 猎犬座Y 质量倍数 3.0 半径倍数 215
EtaCarinae
(
size_scale
=
SIZE_SCALE
,
ignore_mass
=
True
),
# 海山二 质量倍数 100.0 半径倍数 278
CarinaeV382
(
size_scale
=
SIZE_SCALE
,
ignore_mass
=
True
),
# 船底座V382 质量倍数 20.0 半径倍数 350
Antares
(
size_scale
=
SIZE_SCALE
,
ignore_mass
=
True
),
# 心宿二 质量倍数 12 半径倍数 770
Betelgeuse
(
size_scale
=
SIZE_SCALE
,
ignore_mass
=
True
),
# 参宿四 质量倍数 11.6 半径倍数 887
VYCanisMajoris
(
size_scale
=
SIZE_SCALE
,
ignore_mass
=
True
),
# 大犬座VY 质量倍数 25 半径倍数 1419.75
...
...
@@ -43,14 +40,18 @@ if __name__ == '__main__':
distance_sum
=
0
for
idx
,
body
in
enumerate
(
bodies
):
body
.
rotation_speed
/=
10
if
idx
>
1
:
if
body
.
is_fixed_star
:
body
.
light_on
=
False
# 关闭灯光效果,只有太阳对地球有灯光效果
d
=
pow
((
body
.
diameter
+
bodies
[
idx
-
1
].
diameter
)
*
SIZE_SCALE
,
0.75
)
*
80
# d = (body.diameter + bodies[idx - 1].diameter) * SIZE_SCALE * 1.1 + D
body
.
init_position
=
[(
distance_sum
+
d
)
/
2
,
(
distance_sum
+
d
),
0
]
distance_sum
+=
d
if
idx
==
0
:
d
=
0
else
:
d
=
pow
((
body
.
raduis
+
bodies
[
idx
-
1
].
raduis
)
*
SIZE_SCALE
,
1.0
)
*
1.1
# d = (body.diameter + bodies[idx - 1].diameter) * SIZE_SCALE * 1.1 + D
body
.
init_velocity
=
[
0
,
0
,
0
]
body
.
init_position
=
[
body
.
raduis
*
SIZE_SCALE
,
(
distance_sum
+
d
),
AU
]
distance_sum
+=
d
# 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# position = 左-右+、上+下-、前+后-
ursina_run
(
bodies
,
SECONDS_PER_
MONTH
,
position
=
(
0
,
200000
,
-
AU
/
2
00
),
show_trail
=
True
)
ursina_run
(
bodies
,
SECONDS_PER_
WEEK
,
position
=
(
0
,
AU
,
-
AU
/
5
00
),
show_trail
=
True
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录