diff --git a/common/color_utils.py b/common/color_utils.py index d8a17267774bba4cf855b4fa61d09a64bfe00931..62e2c8b352a95163ca5739c646678fb7ade833aa 100644 --- a/common/color_utils.py +++ b/common/color_utils.py @@ -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 diff --git a/sim_scenes/tri_bodies/two_way_foil.py b/sim_scenes/tri_bodies/two_way_foil.py index 5b45f9dd83cacffae14d7a8bf6de5a38ab00b2f8..f8de04fbd3adfd6201e2460b80360695ba1e647f 100644 --- a/sim_scenes/tri_bodies/two_way_foil.py +++ b/sim_scenes/tri_bodies/two_way_foil.py @@ -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