Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
0135ce75
宇宙模拟器
项目概览
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看板
“578f06745c466130c411fb9653f77587f3bb5351”上不存在“bodies/fixed_stars/git@gitcode.net:pythoncr/universe_sim.git”
提交
0135ce75
编写于
11月 09, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
bd901895
变更
6
展开全部
显示空白变更内容
内联
并排
Showing
6 changed file
with
1911 addition
and
18 deletion
+1911
-18
objs/halley_comet.py
objs/halley_comet.py
+1
-1
sim_lab/halley_comet_log.txt
sim_lab/halley_comet_log.txt
+1885
-1
sim_lab/halley_comet_research_calc.py
sim_lab/halley_comet_research_calc.py
+14
-8
sim_scenes/solar_system/halley_comet_lib.py
sim_scenes/solar_system/halley_comet_lib.py
+5
-5
sim_scenes/solar_system/halley_comet_sim.py
sim_scenes/solar_system/halley_comet_sim.py
+4
-2
simulators/ursina/entities/entity_utils.py
simulators/ursina/entities/entity_utils.py
+2
-1
未找到文件。
objs/halley_comet.py
浏览文件 @
0135ce75
...
@@ -49,7 +49,7 @@ class HalleComet(RockSnow):
...
@@ -49,7 +49,7 @@ class HalleComet(RockSnow):
}
}
super
().
__init__
(
**
params
)
super
().
__init__
(
**
params
)
# create_cone(radius, height, subdivisions, r=0.1)
# create_cone(radius, height, subdivisions, r=0.1)
self
.
comet_info
=
(
0.18
,
1.5
,
100
,
0.2
)
self
.
comet_info
=
(
0.18
,
2.0
,
100
,
0.2
)
from
ursina.prefabs.primitives
import
Shader
from
ursina.prefabs.primitives
import
Shader
...
...
sim_lab/halley_comet_log.txt
浏览文件 @
0135ce75
此差异已折叠。
点击以展开。
sim_lab/halley_comet_research_calc.py
浏览文件 @
0135ce75
...
@@ -211,7 +211,7 @@ def calc_simulator(params):
...
@@ -211,7 +211,7 @@ def calc_simulator(params):
2023年12月9日 - 1986年2月9日 = 13817
2023年12月9日 - 1986年2月9日 = 13817
35.1AU 0.586AU
35.1AU 0.586AU
"""
"""
if
abs
(
comet_peri
-
0.586
)
<
0.01
and
abs
(
comet_aphel
-
35.1
)
<
0.1
and
abs
(
diff_days
-
13817
)
<
2
:
if
abs
(
comet_peri
-
0.586
)
<
0.01
and
abs
(
comet_aphel
-
35.1
)
<
0.1
:
#
and abs(diff_days - 13817) < 2:
print
(
"OK ......"
,
comet_peri
,
comet_aphel
,
diff_days
)
print
(
"OK ......"
,
comet_peri
,
comet_aphel
,
diff_days
)
# print("year days:", time_data.years, time_data.days)
# print("year days:", time_data.years, time_data.days)
# print("远日点: %.3f AU(%s)" % (sim.comet_aphel / AU, sim.comet_aphel_dt))
# print("远日点: %.3f AU(%s)" % (sim.comet_aphel / AU, sim.comet_aphel_dt))
...
@@ -272,8 +272,7 @@ if __name__ == '__main__':
...
@@ -272,8 +272,7 @@ if __name__ == '__main__':
# target_function(-2.835, 4.72, 8.847) # 远日点:35.144 AU, 近日点:0.586 AU, 天数: 13748
# target_function(-2.835, 4.72, 8.847) # 远日点:35.144 AU, 近日点:0.586 AU, 天数: 13748
# target_function(-2.835, 4.71, 8.86) # 远日点:35.243 AU, 近日点:0.584 AU, 天数: 13809
# target_function(-2.835, 4.71, 8.86) # 远日点:35.243 AU, 近日点:0.584 AU, 天数: 13809
# target_function(-2.835, 4.73, 8.85) # OK 远日点:35.251 AU, 近日点:0.585 AU, 天数: 13815
# target_function(-2.835, 4.73, 8.85) # OK 远日点:35.251 AU, 近日点:0.585 AU, 天数: 13815
a
,
b
,
c
=
target_function
(
-
2.47
,
5.13
,
8.73
)
# a, b, c = target_function(-2.47, 5.13, 8.73)
# [-2.5, 5.02, 8.763] 远日点:35.032 AU, 近日点:0.477 AU, 天数: 13615
# [-2.5, 5.02, 8.763] 远日点:35.032 AU, 近日点:0.477 AU, 天数: 13615
# [-2.835, 4.81, 8.8] 远日点:35.161 AU, 近日点:0.591 AU, 天数: 13754
# [-2.835, 4.81, 8.8] 远日点:35.161 AU, 近日点:0.591 AU, 天数: 13754
...
@@ -292,11 +291,18 @@ if __name__ == '__main__':
...
@@ -292,11 +291,18 @@ if __name__ == '__main__':
# 远日点: 35.086 AU((40, 346, 14946.8522))
# 远日点: 35.086 AU((40, 346, 14946.8522))
# 近日点: 0.586 AU((3, 133, 1228.3418))
# 近日点: 0.586 AU((3, 133, 1228.3418))
# 远\近日天数: 13718 天
# 远\近日天数: 13718 天
R
=
2
# for x in range(-2,2):
# X, Y, Z = -2.835, 4.73, 8.85
# for y in range(-2, 2):
X
,
Y
,
Z
=
-
2.835
,
4.72
,
8.847
# for z in range(-2, 2):
X
,
Y
,
Z
=
-
2.826
,
4.695
,
8.86
idx
=
0
for
x
in
range
(
-
R
,
R
+
1
):
for
y
in
range
(
-
R
,
R
+
1
):
for
z
in
range
(
-
R
,
R
+
1
):
x
,
y
,
z
=
X
+
(
x
/
100
),
Y
+
(
y
/
100
),
Z
+
(
z
/
100
)
idx
+=
1
print
(
f
"Index:
{
idx
}
---------------------------"
)
a
,
b
,
c
=
target_function
(
x
,
y
,
z
)
# def t():
# def t():
# global idx
# global idx
# params = HalleyCometParams(
# params = HalleyCometParams(
...
...
sim_scenes/solar_system/halley_comet_lib.py
浏览文件 @
0135ce75
...
@@ -34,7 +34,7 @@ def create_halley_comet(init_velocity, init_position):
...
@@ -34,7 +34,7 @@ def create_halley_comet(init_velocity, init_position):
# 每76.1年环绕太阳一周的周期彗星
# 每76.1年环绕太阳一周的周期彗星
halley_comet
=
HalleComet
(
halley_comet
=
HalleComet
(
# size_scale=4e7,
# size_scale=4e7,
size_scale
=
1
e8
,
size_scale
=
0.2
e8
,
init_velocity
=
init_velocity
,
init_velocity
=
init_velocity
,
init_position
=
init_position
)
\
init_position
=
init_position
)
\
.
set_light_disable
(
True
)
.
set_light_disable
(
True
)
...
@@ -73,10 +73,10 @@ class HalleyCometSimBase:
...
@@ -73,10 +73,10 @@ class HalleyCometSimBase:
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
)
self
.
mars
=
Mars
(
size_scale
=
4e3
,
show_trail
=
show_trail
)
self
.
mars
=
Mars
(
size_scale
=
4e3
,
show_trail
=
show_trail
)
self
.
jupiter
=
Jupiter
(
size_scale
=
2.5
e3
,
show_trail
=
show_trail
)
self
.
jupiter
=
Jupiter
(
size_scale
=
0.8
e3
,
show_trail
=
show_trail
)
self
.
saturn
=
Saturn
(
size_scale
=
2.5
e3
,
show_trail
=
show_trail
)
self
.
saturn
=
Saturn
(
size_scale
=
0.8
e3
,
show_trail
=
show_trail
)
self
.
uranus
=
Uranus
(
size_scale
=
6
e3
,
show_trail
=
show_trail
)
self
.
uranus
=
Uranus
(
size_scale
=
3
e3
,
show_trail
=
show_trail
)
self
.
neptune
=
Neptune
(
size_scale
=
6
e3
,
show_trail
=
show_trail
)
self
.
neptune
=
Neptune
(
size_scale
=
3
e3
,
show_trail
=
show_trail
)
self
.
pluto
=
Pluto
(
size_scale
=
1e5
,
show_trail
=
show_trail
)
self
.
pluto
=
Pluto
(
size_scale
=
1e5
,
show_trail
=
show_trail
)
self
.
bodies
=
[
self
.
bodies
=
[
self
.
sun
,
# 太阳
self
.
sun
,
# 太阳
...
...
sim_scenes/solar_system/halley_comet_sim.py
浏览文件 @
0135ce75
...
@@ -66,7 +66,8 @@ class HalleyCometSim(HalleyCometSimBase):
...
@@ -66,7 +66,8 @@ class HalleyCometSim(HalleyCometSimBase):
# UrsinaConfig.trail_type = "line"
# UrsinaConfig.trail_type = "line"
# UrsinaConfig.trail_thickness_factor = 3
# UrsinaConfig.trail_thickness_factor = 3
# UrsinaConfig.trail_length = 91
# UrsinaConfig.trail_length = 91
UrsinaConfig
.
trail_length
=
225
UrsinaConfig
.
trail_length
=
180
UrsinaConfig
.
trail_factor
=
3
# camera.clip_plane_near = 0.1
# camera.clip_plane_near = 0.1
camera
.
clip_plane_far
=
1000000
camera
.
clip_plane_far
=
1000000
create_sphere_sky
(
scale
=
200000
)
create_sphere_sky
(
scale
=
200000
)
...
@@ -227,7 +228,8 @@ if __name__ == '__main__':
...
@@ -227,7 +228,8 @@ if __name__ == '__main__':
# 2019年5月6日 34.772
# 2019年5月6日 34.772
params
=
HalleyCometParams
(
params
=
HalleyCometParams
(
start_time
=
'1982-09-24 00:00:00'
,
start_time
=
'1982-09-24 00:00:00'
,
init_velocity
=
[
-
2.835
,
4.72
,
8.847
],
# init_velocity=[-2.835, 4.72, 8.847],
init_velocity
=
[
-
2.826
,
4.695
,
8.86
],
# init_velocity=[-2.836, 4.705, 8.85],
# init_velocity=[-2.836, 4.705, 8.85],
init_position
=
[
0
,
-
5
*
AU
,
-
10
*
AU
]
init_position
=
[
0
,
-
5
*
AU
,
-
10
*
AU
]
)
)
...
...
simulators/ursina/entities/entity_utils.py
浏览文件 @
0135ce75
...
@@ -125,7 +125,8 @@ def create_trails(parent):
...
@@ -125,7 +125,8 @@ def create_trails(parent):
return
return
else
:
else
:
# 如果位置比较近,就不创建拖尾了,保证拖尾间隔一定的距离
# 如果位置比较近,就不创建拖尾了,保证拖尾间隔一定的距离
if
last_pos_distance
<
parent
.
trail_scale
*
trail_int_scale
:
# 间隔距离不小于1.2倍的拖尾球体
# 间隔距离不小于1.2倍的拖尾球体
if
last_pos_distance
<
parent
.
trail_scale
*
trail_int_scale
*
UrsinaConfig
.
trail_factor
:
return
return
if
UrsinaConfig
.
trail_type
==
"line"
:
if
UrsinaConfig
.
trail_type
==
"line"
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录