Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
209b57b0
宇宙模拟器
项目概览
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看板
提交
209b57b0
编写于
7月 26, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
aec59bc4
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
28 addition
and
23 deletion
+28
-23
sim_scenes/earth/earth_3d.py
sim_scenes/earth/earth_3d.py
+3
-2
sim_scenes/fiction/transformed_mars_ani_3d.py
sim_scenes/fiction/transformed_mars_ani_3d.py
+6
-6
sim_scenes/fiction/transformed_planet.py
sim_scenes/fiction/transformed_planet.py
+8
-10
sim_scenes/solar_system/hd_mercury_3d.py
sim_scenes/solar_system/hd_mercury_3d.py
+3
-3
tools/sim_video_3d_cap_ext.py
tools/sim_video_3d_cap_ext.py
+4
-2
tools/video_cap_main.py
tools/video_cap_main.py
+4
-0
未找到文件。
sim_scenes/earth/earth_3d.py
浏览文件 @
209b57b0
...
...
@@ -29,9 +29,10 @@ if __name__ == '__main__':
bodies
=
[
earth
,
clouds
]
#
3D摄像机初始化
#
TODO: 开启3D摄像机
from
simulators.ursina.entities.camera3d
import
Camera3d
Camera3d
.
init
()
# 3D摄像机初始化(眼睛的距离为1000公里效果)
Camera3d
.
init
(
eye_distance
=
1000
)
# 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
...
...
sim_scenes/fiction/transformed_mars_ani_3d.py
浏览文件 @
209b57b0
...
...
@@ -7,17 +7,14 @@
# python_version :3.8
# ==============================================================================
import
os
import
numpy
as
np
import
sys
from
bodies
import
Earth
from
objs
import
Satellite
,
Satellite2
from
common.consts
import
SECONDS_PER_HOUR
from
objs
import
Satellite2
from
sim_scenes.func
import
ursina_run
from
simulators.ursina.entities.body_timer
import
TimeData
from
simulators.ursina.entities.camera3d
import
Camera3d
from
simulators.ursina.entities.entity_utils
import
create_directional_light
from
simulators.ursina.ursina_config
import
UrsinaConfig
from
simulators.ursina.ursina_event
import
UrsinaEvent
...
...
@@ -84,7 +81,10 @@ def transformed_mars_ani(transformed_texture=None, texture=None, camera3d=False)
bodies
.
append
(
clouds
)
if
camera3d
:
Camera3d
.
init
()
# TODO: 开启3D摄像机
from
simulators.ursina.entities.camera3d
import
Camera3d
# 3D摄像机初始化(眼睛的距离为1000公里效果)
Camera3d
.
init
(
eye_distance
=
1000
)
def
on_ready
():
# 为了较好的立体效果,可以增加太阳光线,光线指向火星(target=mars)
...
...
sim_scenes/fiction/transformed_planet.py
浏览文件 @
209b57b0
...
...
@@ -6,18 +6,13 @@
# link :https://gitcode.net/pythoncr/
# python_version :3.8
# ==============================================================================
import
numpy
as
np
from
bodies
import
Earth
from
common.consts
import
SECONDS_PER_HOUR
,
SECONDS_PER_DAY
,
AU
from
sim_scenes.func
import
ursina_run
,
camera_look_at
,
create_3d_card
from
simulators.ursina.entities.body_timer
import
TimeData
from
simulators.ursina.entities.camera3d
import
Camera3d
from
simulators.ursina.ursina_config
import
UrsinaConfig
from
simulators.ursina.ursina_event
import
UrsinaEvent
from
ursina
import
camera
import
os
from
bodies
import
Earth
from
common.consts
import
SECONDS_PER_HOUR
from
sim_scenes.func
import
ursina_run
def
run_transformed_planet
(
transformed_texture
=
None
,
texture
=
None
,
with_clouds
=
True
,
camera3d
=
False
,
transparent
=
True
):
if
transformed_texture
is
not
None
:
...
...
@@ -44,7 +39,10 @@ def run_transformed_planet(transformed_texture=None, texture=None, with_clouds=T
bodies
.
append
(
clouds
)
if
camera3d
:
Camera3d
.
init
()
# TODO: 开启3D摄像机
from
simulators.ursina.entities.camera3d
import
Camera3d
# 3D摄像机初始化(眼睛的距离为1000公里效果)
Camera3d
.
init
(
eye_distance
=
1000
)
# 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
...
...
sim_scenes/solar_system/hd_mercury_3d.py
浏览文件 @
209b57b0
...
...
@@ -21,10 +21,10 @@ if __name__ == '__main__':
]
mercury
=
bodies
[
0
]
# TODO: 3D摄像机
# TODO:
开启
3D摄像机
from
simulators.ursina.entities.camera3d
import
Camera3d
# 3D摄像机初始化
Camera3d
.
init
()
# 3D摄像机初始化
(眼睛的距离为1000公里效果)
Camera3d
.
init
(
eye_distance
=
1000
)
# 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
...
...
tools/sim_video_3d_cap_ext.py
浏览文件 @
209b57b0
...
...
@@ -307,13 +307,13 @@ def make_3d_video():
last_index
=
index
index
=
index
+
index_base
completed_index
=
index
# 清除识别块的颜色为黑色
img
[
4
:
21
,
3
:
20
,
]
=
[
0
,
0
,
0
]
if
_3d_card_p
[
2
]
<
100
:
_3d_card_color
=
"b"
_3d_card_direct
=
"right"
if
index
not
in
r_frames
.
keys
():
# 清除识别块的颜色为周边的背景色
img
[
4
:
21
,
3
:
20
,
]
=
img
[
22
:
23
,
21
:
22
,
][
0
][
0
]
r_frames
[
index
]
=
img
[:
cut_h
,
:
cut_w
,
]
else
:
return
False
...
...
@@ -321,6 +321,8 @@ def make_3d_video():
_3d_card_color
=
"w"
_3d_card_direct
=
"left"
if
index
not
in
l_frames
.
keys
():
# 清除识别块的颜色为周边的背景色
img
[
4
:
21
,
3
:
20
,
]
=
img
[
22
:
23
,
21
:
22
,
][
0
][
0
]
l_frames
[
index
]
=
img
[:
cut_h
,
:
cut_w
,
]
else
:
return
False
...
...
tools/video_cap_main.py
浏览文件 @
209b57b0
...
...
@@ -18,6 +18,10 @@ def browse_file():
input_entry
.
insert
(
0
,
file_path
)
output_entry
.
delete
(
0
,
tk
.
END
)
output_entry
.
insert
(
0
,
file_path
[
0
:
-
3
]
+
".mp4"
)
if
file_path
.
endswith
(
"_3d.py"
)
and
checkbox3d_var
.
get
()
!=
1
:
checkbox3d
.
select
()
check3d
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录