diff --git a/scenes/fiction/__init__.py b/scenes/fiction/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/scenes/fixed_stars.py b/scenes/fiction/fixed_stars.py similarity index 100% rename from scenes/fixed_stars.py rename to scenes/fiction/fixed_stars.py diff --git a/scenes/sun_dysen_sphere.py b/scenes/fiction/sun_dysen_sphere.py similarity index 100% rename from scenes/sun_dysen_sphere.py rename to scenes/fiction/sun_dysen_sphere.py diff --git a/scenes/science/__init__.py b/scenes/science/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/scenes/gravity_slingshot.py b/scenes/science/gravity_slingshot.py similarity index 100% rename from scenes/gravity_slingshot.py rename to scenes/science/gravity_slingshot.py diff --git a/scenes/solar_system/__init__.py b/scenes/solar_system/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/scenes/earth_at_night.py b/scenes/solar_system/earth_at_night.py similarity index 100% rename from scenes/earth_at_night.py rename to scenes/solar_system/earth_at_night.py diff --git a/scenes/earth_moon.py b/scenes/solar_system/earth_moon.py similarity index 100% rename from scenes/earth_moon.py rename to scenes/solar_system/earth_moon.py diff --git a/scenes/mercury_high_resolution.py b/scenes/solar_system/mercury_high_resolution.py similarity index 100% rename from scenes/mercury_high_resolution.py rename to scenes/solar_system/mercury_high_resolution.py diff --git a/scenes/solar_system_1.py b/scenes/solar_system/solar_system_1.py similarity index 100% rename from scenes/solar_system_1.py rename to scenes/solar_system/solar_system_1.py diff --git a/scenes/solar_system_2.py b/scenes/solar_system/solar_system_2.py similarity index 100% rename from scenes/solar_system_2.py rename to scenes/solar_system/solar_system_2.py diff --git a/scenes/solar_system_3.py b/scenes/solar_system/solar_system_3.py similarity index 100% rename from scenes/solar_system_3.py rename to scenes/solar_system/solar_system_3.py diff --git a/scenes/sun_earth.py b/scenes/solar_system/sun_earth.py similarity index 100% rename from scenes/sun_earth.py rename to scenes/solar_system/sun_earth.py diff --git a/scenes/sun_earth_jupiter.py b/scenes/solar_system/sun_earth_jupiter.py similarity index 100% rename from scenes/sun_earth_jupiter.py rename to scenes/solar_system/sun_earth_jupiter.py diff --git a/scenes/sun_earth_moon.py b/scenes/solar_system/sun_earth_moon.py similarity index 100% rename from scenes/sun_earth_moon.py rename to scenes/solar_system/sun_earth_moon.py diff --git a/scenes/tri_bodies/__init__.py b/scenes/tri_bodies/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/scenes/three_body_01.py b/scenes/tri_bodies/three_body_01.py similarity index 100% rename from scenes/three_body_01.py rename to scenes/tri_bodies/three_body_01.py diff --git a/scenes/three_body_02.py b/scenes/tri_bodies/three_body_02.py similarity index 100% rename from scenes/three_body_02.py rename to scenes/tri_bodies/three_body_02.py diff --git a/scenes/three_body_03.py b/scenes/tri_bodies/three_body_03.py similarity index 100% rename from scenes/three_body_03.py rename to scenes/tri_bodies/three_body_03.py diff --git a/scenes/tri_bodies_sim_perfect.py b/scenes/tri_bodies/tri_bodies_sim_perfect.py similarity index 100% rename from scenes/tri_bodies_sim_perfect.py rename to scenes/tri_bodies/tri_bodies_sim_perfect.py diff --git a/scenes/two_body_01.py b/scenes/tri_bodies/two_body_01.py similarity index 100% rename from scenes/two_body_01.py rename to scenes/tri_bodies/two_body_01.py diff --git a/simulators/manim_simulator.py b/simulators/manim_simulator.py deleted file mode 100644 index 55cc0be0505372ae783b6f1a14f9f9f044065d1c..0000000000000000000000000000000000000000 --- a/simulators/manim_simulator.py +++ /dev/null @@ -1,73 +0,0 @@ -# -*- coding:utf-8 -*- -# title :manim天体运行模拟器 -# description :manim天体运行模拟器 -# author :Python超人 -# date :2023-02-11 -# link :https://gitcode.net/pythoncr/ -# python_version :3.8 -# manim version :Manim Community v0.17.2 -# ============================================================================== -# 环境安装教程参考: -# https://blog.csdn.net/FRIGIDWINTER/article/details/121526956 - -import os -from manim import * -from manim import * -from manim.mobject.three_d import Sphere -from manim.three_d.light import * -from manim.mobject.opengl import * -from PIL import Image - - -class TexturedSphere(ThreeDVMobject): - def __init__(self, radius=1, u_min=0, u_max=1, v_min=0, v_max=1, **kwargs): - self.radius = radius - self.u_min = u_min - self.u_max = u_max - self.v_min = v_min - self.v_max = v_max - super().__init__(**kwargs) - - def init_points(self): - sphere = Sphere(radius=self.radius).mesh - for i in range(len(sphere[0])): - u, v = sphere[0][i], sphere[1][i] - self.add_point(self.radius * np.array([ - np.cos(u) * np.sin(v), - np.sin(u) * np.sin(v), - np.cos(v) - ])) - self.add_tex_coords([ - interpolate(self.u_min, self.u_max, u / (2 * np.pi)), - interpolate(self.v_min, self.v_max, v / np.pi) - ]) - self.set_color_by_tex() - - def set_color_by_tex(self, texture_file='saturn.jpg'): - texture_path = f'textures/{texture_file}' - texture = Image.open(texture_path).transpose(Image.FLIP_TOP_BOTTOM).convert('RGBA') - self.set_texture(texture) - - -class TexturedSaturn(Scene): - def construct(self): - sphere = TexturedSphere(radius=2.5, texture_file='saturn.jpg') - rings = TexturedSphere(radius=3.5, texture_file='saturnRings.jpg', u_min=0.2, u_max=0.8, v_min=0.2, v_max=0.8) - rings.set_rotation(right=PI / 2) - rings.set_shade_in_3d(True) - rings.set_opacity(0.8) - - light = ThreeDPointLight( - location=5 * OUT + 5 * RIGHT + 5 * UP, - color=WHITE, - ) - ambient = ThreeDAmbientLight(color="#444444") - self.add(light, ambient, sphere, rings) - self.set_camera_orientation(phi=75 * DEGREES, theta=-30 * DEGREES) - self.begin_ambient_camera_rotation(rate=0.2) - self.wait(20) - self.stop_ambient_camera_rotation() - - -if __name__ == '__main__': - os.system("manim -pqh manim_simulator.py TexturedSaturn") diff --git a/simulators/pyglet_simulator.py b/simulators/pyglet_simulator.py deleted file mode 100644 index fdedce165d8eb2098cd751196f91bcd340c39c42..0000000000000000000000000000000000000000 --- a/simulators/pyglet_simulator.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding:utf-8 -*- -# title :pyglet天体运行模拟器 -# description :pyglet天体运行模拟器 -# author :Python超人 -# date :2023-02-11 -# link :https://gitcode.net/pythoncr/ -# python_version :3.8 -# ============================================================================== -# pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com pyglet