提交 10190ece 编写于 作者: 三月三net's avatar 三月三net

Python超人-宇宙模拟器

上级 17831ee0
......@@ -123,6 +123,7 @@ def ursina_run(bodies,
show_timer=False,
timer_enabled=False,
save_as_json=None,
save_cube_map=False,
save_as_video=False,
view_closely=False):
"""
......@@ -172,9 +173,12 @@ def ursina_run(bodies,
view_azimuth = 0 # 暂时未用
player = UrsinaPlayer(position, view_azimuth, simulator.ursina_views)
# if save_as_video:
# from common.video_recorder import VideoRecorder
# vr = VideoRecorder()
if save_cube_map:
from simulators.ursina.entities.video_recorder import VideoRecorder
from ursina import camera
import sys
sys.modules["__main__"].video_recorder = VideoRecorder()
camera.fov = 90
def callback_update():
UrsinaEvent.on_application_run()
......@@ -183,8 +187,8 @@ def ursina_run(bodies,
if ursina_view.appeared:
ursina_view.update()
# if save_as_video:
# vr.screenshot()
if save_cube_map:
sys.modules["__main__"].video_recorder.screenshot()
import sys
from simulators.ursina.ursina_config import UrsinaConfig
......
......@@ -38,8 +38,8 @@ class VideoRecorder(Entity):
if self.t >= 1 / self.fps:
base.saveCubeMap(
namePrefix=f'\\{self.temp_dir}\\cmap_' + str(self.i).zfill(self.sd) + '_#.png',
size=1024
namePrefix=f'\\{self.temp_dir}\\cmap_' + str(self.i).zfill(self.sd) + '_#.jpg',
size=2048
# namePrefix = 'cube_map_#.png'
)
self.t = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册