提交 7387b622 编写于 作者: 三月三net's avatar 三月三net

Python超人-宇宙模拟器

上级 f0f3be5c
......@@ -34,21 +34,6 @@ def conv_to_vec4_color(colour: tuple, alpha=1):
# color = ursina_color.rgba(r, g, b, a)
# def brightest(color):
# if isinstance(color, tuple):
# r, g, b = color
# elif isinstance(color, list):
# r, g, b = color
#
# brightest_color 等于的值就是 r g b 同时按照比例增加,直到 r g b 其中一个值达到 255 为止,
# 比如: r=127 g=20 b=40,则 brightest_color=127*2 约等于 255, g=20*2=40 b=40*2=80
# brightest_color的 r g b 就等于 255 40 80
# 请实现以下代码:
# TODO:
#
#
# return brightest_color
def brightest(color):
if isinstance(color, tuple):
r, g, b = color
......
......@@ -104,38 +104,6 @@ class TwoWayFoilSim:
ext_fun_for_method(self.two_way_foil.planet, after_run_fun=change_two_way_foil)
# def flatten_animation(self, body):
# """
# 天体二维化的动画
# @param body: 天体
# @return:
# """
#
# def flatten_update(planet):
# def warp():
# # 原始的 update 方法中有计算天体的运行
# planet.original_update()
#
# # 对Y轴进行压平动画,如果压平大小不足 1/50,则继续压缩,直到压缩到 1/50 就不压缩了
# # (如果觉得 1/50 的厚度压的不够,还可以继续压缩,基本上就够了)
# if planet.scale_y_v > planet.init_scale_y / 50:
# planet.scale_y_v /= 1.01
# # 灯光关闭,不然压到2纬就会是黑色
# planet.set_light_off(True)
# planet.scale_y = planet.scale_y_v
#
# return warp
#
# body.is_2d = True
# # 压平时,转速将为以前的 1/20
# body.planet.rotation_speed /= 20
# # 记录原始的厚度大小
# body.planet.scale_y_v = body.planet.scale_y
# body.planet.init_scale_y = body.planet.scale_y
# # 原始的 update 方法中有计算天体的运行,需要保留
# body.planet.original_update = body.planet.update
# # 替换 update
# body.planet.update = flatten_update(body.planet)
def gen_pixcel_image(self, planet):
"""
将纹理图改为像素图片
......@@ -189,8 +157,8 @@ class TwoWayFoilSim:
return warp
body.is_2d = True
# 压平时,转速将为以前的 1/20
body.planet.rotation_speed /= 20
# 压平时,转速将为以前的 1/200
body.planet.rotation_speed /= 200
# 记录原始的厚度大小
body.planet.scale_y_v = body.planet.scale_y
body.planet.init_scale_y = body.planet.scale_y
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册