From 402ca47b3a02e936110b7bb19cbed2994cefac16 Mon Sep 17 00:00:00 2001 From: march3 Date: Sun, 2 Apr 2023 21:56:02 +0800 Subject: [PATCH] =?UTF-8?q?Python=E8=B6=85=E4=BA=BA-=E5=AE=87=E5=AE=99?= =?UTF-8?q?=E6=A8=A1=E6=8B=9F=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sim_scenes/solar_system/sun_earth_moon.py | 4 ++-- simulators/ursina/entities/body_trail.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/sim_scenes/solar_system/sun_earth_moon.py b/sim_scenes/solar_system/sun_earth_moon.py index 3395ccd..b26c69d 100644 --- a/sim_scenes/solar_system/sun_earth_moon.py +++ b/sim_scenes/solar_system/sun_earth_moon.py @@ -24,11 +24,11 @@ if __name__ == '__main__': # 观看月相变化的过程:分别是 新月、蛾眉月、上弦月、盈凸、满月、亏凸、下弦月、残月 # 参考:images/moon/月相变化过程.jpeg # TODO: 月球在摄像机的前方(从 “新月” 开始) - # moon_pos, moon_vel = [0, 0, 384400], [-(EARTH_INIT_VELOCITY + 1.023), 0, 0] + moon_pos, moon_vel = [0, 0, 384400], [-(EARTH_INIT_VELOCITY + 1.023), 0, 0] # TODO: 月球在摄像机的右方(从 “下弦月” 开始),将会从右方出现 # moon_pos, moon_vel = [384400, 0, 0], [-EARTH_INIT_VELOCITY, 0, 1.023] # TODO: 月球在摄像机的左方(从 “上弦月” 开始) - moon_pos, moon_vel = [-384400, 0, 0], [EARTH_INIT_VELOCITY, 0, -1.023] + # moon_pos, moon_vel = [-384400, 0, 0], [EARTH_INIT_VELOCITY, 0, -1.023] bodies = [ sun, diff --git a/simulators/ursina/entities/body_trail.py b/simulators/ursina/entities/body_trail.py index 3f4cb06..7b43d9e 100644 --- a/simulators/ursina/entities/body_trail.py +++ b/simulators/ursina/entities/body_trail.py @@ -51,3 +51,21 @@ class BodyTrail(Entity): a_text.parent = self a_arrow.enabled = False a_line.enabled = False + + +# class BodyTrail(Entity): +# def __init__(self, **kwargs): +# from_pos = (0, 0, 0) +# to_pos = (1, 1, 1) +# super().__init__( +# # model='line', +# model=Mesh(vertices=(from_pos, to_pos), mode='line', thickness=3), +# ignore_paused=True, +# **kwargs +# ) +# +# def update(self): +# self.look_at(self.parent) +# # line = Entity(parent=parent, +# # model=Mesh(vertices=(from_pos * len_scale, to_pos * len_scale), mode='line', thickness=thickness), +# # color=color, alpha=alpha) -- GitLab