Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
a62d3850
宇宙模拟器
项目概览
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看板
提交
a62d3850
编写于
10月 09, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
a39aa76d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
93 addition
and
19 deletion
+93
-19
sim_scenes/solar_system/hd_pluto_3d.py
sim_scenes/solar_system/hd_pluto_3d.py
+39
-0
sim_scenes/solar_system/hd_venus_3d.py
sim_scenes/solar_system/hd_venus_3d.py
+39
-0
sim_scenes/tri_bodies/tri_bodies_perfect.py
sim_scenes/tri_bodies/tri_bodies_perfect.py
+1
-1
sim_scenes/tri_bodies/two_bodies_01.py
sim_scenes/tri_bodies/two_bodies_01.py
+2
-2
sim_scenes/tri_bodies/water_drop_01.py
sim_scenes/tri_bodies/water_drop_01.py
+3
-4
sim_scenes/tri_bodies/water_drop_02.py
sim_scenes/tri_bodies/water_drop_02.py
+9
-12
未找到文件。
sim_scenes/solar_system/hd_pluto_3d.py
0 → 100644
浏览文件 @
a62d3850
# -*- coding:utf-8 -*-
# title :高清冥王星3D效果
# description :高清冥王星3D效果
# author :Python超人
# date :2023-10-09
# link :https://gitcode.net/pythoncr/
# python_version :3.8
# ==============================================================================
from
bodies
import
Pluto
from
common.consts
import
SECONDS_PER_WEEK
,
SECONDS_PER_DAY
from
sim_scenes.func
import
ursina_run
if
__name__
==
'__main__'
:
"""
高清冥王星3D效果
"""
bodies
=
[
Pluto
(
texture
=
"pluto.png"
,
init_position
=
[
0
,
0
,
0
],
init_velocity
=
[
0
,
0
,
0
],
size_scale
=
2
,
show_name
=
False
)
]
pluto
=
bodies
[
0
]
# TODO: 开启3D摄像机
from
simulators.ursina.entities.camera3d
import
Camera3d
# 3D摄像机初始化(两眼到鼻梁的距离为1000公里效果)
Camera3d
.
init
(
eye_distance
=
1000
)
# 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# position = 左-右+、上+下-、前+后-
ursina_run
(
bodies
,
SECONDS_PER_DAY
,
position
=
(
4
*
pluto
.
radius
,
0
,
-
13500
),
# cosmic_bg="", # 无背景(黑色)
show_grid
=
False
,
# 不显示网格
show_camera_info
=
False
,
# 不显示摄像机信息
show_control_info
=
False
,
# 不显示控制提示信息
view_closely
=
0.001
)
sim_scenes/solar_system/hd_venus_3d.py
0 → 100644
浏览文件 @
a62d3850
# -*- coding:utf-8 -*-
# title :高清金星3D效果
# description :高清金星3D效果
# author :Python超人
# date :2023-10-09
# link :https://gitcode.net/pythoncr/
# python_version :3.8
# ==============================================================================
from
bodies
import
Venus
from
common.consts
import
SECONDS_PER_WEEK
,
SECONDS_PER_DAY
from
sim_scenes.func
import
ursina_run
if
__name__
==
'__main__'
:
"""
高清金星3D效果
"""
bodies
=
[
Venus
(
texture
=
"venus_hd.jpg"
,
init_position
=
[
0
,
0
,
0
],
init_velocity
=
[
0
,
0
,
0
],
size_scale
=
1
,
show_name
=
False
)
]
venus
=
bodies
[
0
]
# TODO: 开启3D摄像机
from
simulators.ursina.entities.camera3d
import
Camera3d
# 3D摄像机初始化(两眼到鼻梁的距离为1000公里效果)
Camera3d
.
init
(
eye_distance
=
1000
)
# 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# position = 左-右+、上+下-、前+后-
ursina_run
(
bodies
,
SECONDS_PER_DAY
,
position
=
(
1.4
*
venus
.
radius
,
0
,
-
28000
),
# cosmic_bg="", # 无背景(黑色)
show_grid
=
False
,
# 不显示网格
show_camera_info
=
False
,
# 不显示摄像机信息
show_control_info
=
False
,
# 不显示控制提示信息
view_closely
=
0.001
)
sim_scenes/tri_bodies/tri_bodies_perfect.py
浏览文件 @
a62d3850
# -*- coding:utf-8 -*-
# -*- coding:utf-8 -*-
# title :三体场景模拟
01
# title :三体场景模拟
# description :三体场景模拟(3个太阳、1个地球)
# description :三体场景模拟(3个太阳、1个地球)
# author :Python超人
# author :Python超人
# date :2023-02-11
# date :2023-02-11
...
...
sim_scenes/tri_bodies/two_bodies_01.py
浏览文件 @
a62d3850
# -*- coding:utf-8 -*-
# -*- coding:utf-8 -*-
# title :
三
体场景模拟01
# title :
两
体场景模拟01
# description :
三体场景模拟
(2个太阳、1个地球)
# description :
两体场景模拟01
(2个太阳、1个地球)
# author :Python超人
# author :Python超人
# date :2023-02-11
# date :2023-02-11
# link :https://gitcode.net/pythoncr/
# link :https://gitcode.net/pythoncr/
...
...
sim_scenes/tri_bodies/water_drop_01.py
浏览文件 @
a62d3850
# -*- coding:utf-8 -*-
# -*- coding:utf-8 -*-
# title :
地月
场景模拟
# title :
三体水滴
场景模拟
# description :
地月场景模拟(月球始终一面朝向地球、月球对地球的扰动)
# description :
三体水滴场景模拟
# author :Python超人
# author :Python超人
# date :2023-05-01
# date :2023-05-01
# link :https://gitcode.net/pythoncr/
# link :https://gitcode.net/pythoncr/
...
@@ -20,8 +20,7 @@ from ursina import camera
...
@@ -20,8 +20,7 @@ from ursina import camera
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
"""
"""
月球始终一面朝向地球
三体水滴场景模拟
月球对地球的扰动
"""
"""
OFFSETTING
=
0
OFFSETTING
=
0
WATER_SPEED
=
400
WATER_SPEED
=
400
...
...
sim_scenes/tri_bodies/water_drop_02.py
浏览文件 @
a62d3850
# -*- coding:utf-8 -*-
# -*- coding:utf-8 -*-
# title :
地月
场景模拟
# title :
三体水滴
场景模拟
# description :
地月场景模拟(月球始终一面朝向地球、月球对地球的扰动)
# description :
三体水滴场景模拟
# author :Python超人
# author :Python超人
# date :2023-05-01
# date :2023-05-01
# link :https://gitcode.net/pythoncr/
# link :https://gitcode.net/pythoncr/
...
@@ -20,8 +20,7 @@ from ursina import camera
...
@@ -20,8 +20,7 @@ from ursina import camera
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
"""
"""
月球始终一面朝向地球
三体水滴场景模拟
月球对地球的扰动
"""
"""
OFFSETTING
=
0
OFFSETTING
=
0
WATER_SPEED
=
400
WATER_SPEED
=
400
...
@@ -46,12 +45,12 @@ if __name__ == '__main__':
...
@@ -46,12 +45,12 @@ if __name__ == '__main__':
water_drop
=
WaterDrop
(
water_drop
=
WaterDrop
(
init_position
=
[
0
,
0
,
0
],
init_position
=
[
0
,
0
,
0
],
# texture="drops_bright.png",
# texture="drops_bright.png",
# trail_color=[200, 200, 255],
# trail_color=[200, 200, 255],
init_velocity
=
[
0
,
0
,
0
],
init_velocity
=
[
0
,
0
,
0
],
# size_scale=4e4,
# size_scale=4e4,
size_scale
=
3e3
size_scale
=
3e3
).
set_ignore_gravity
(
True
).
set_light_disable
(
True
)
).
set_ignore_gravity
(
True
).
set_light_disable
(
True
)
# moon = Moon(init_position=[0, 0, 363104], # 距地距离约: 363104 至 405696 km
# moon = Moon(init_position=[0, 0, 363104], # 距地距离约: 363104 至 405696 km
# init_velocity=[-1.03, 0, 0], size_scale=2e1) # 月球放大 10 倍,距离保持不变
# init_velocity=[-1.03, 0, 0], size_scale=2e1) # 月球放大 10 倍,距离保持不变
# moon.set_light_disable(True)
# moon.set_light_disable(True)
...
@@ -114,12 +113,10 @@ if __name__ == '__main__':
...
@@ -114,12 +113,10 @@ if __name__ == '__main__':
application
.
time_scale
=
1
application
.
time_scale
=
1
# # 订阅事件后,上面2个函数功能才会起作用
# # 订阅事件后,上面2个函数功能才会起作用
# # 运行前会触发 on_ready
# # 运行前会触发 on_ready
UrsinaEvent
.
on_ready_subscription
(
on_ready
)
UrsinaEvent
.
on_ready_subscription
(
on_ready
)
# 使用 ursina 查看的运行效果
# 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# position = 左-右+、上+下-、前+后-
# position = 左-右+、上+下-、前+后-
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录