From 0815fd5f7a0a34c37a1cf1466357e115f56d0dc3 Mon Sep 17 00:00:00 2001 From: march3 Date: Fri, 28 Jul 2023 15:43:30 +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/solar_system_reality.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sim_scenes/solar_system/solar_system_reality.py b/sim_scenes/solar_system/solar_system_reality.py index b17caa7..42e54a3 100644 --- a/sim_scenes/solar_system/solar_system_reality.py +++ b/sim_scenes/solar_system/solar_system_reality.py @@ -130,14 +130,14 @@ current_time = Time.now() if __name__ == '__main__': # 以下展示的效果为太阳系真实的时间和位置 # 由于宇宙空间尺度非常大,如果按照实际的天体大小,则无法看到天体,因此需要对天体的尺寸进行放大 - sun = Sun(name="太阳", size_scale=0.4e2) # 太阳放大 40 倍,TODO:调试时的大小,size_scale=0.04e2 + sun = Sun(name="太阳", size_scale=0.04e2) # 太阳放大 40 倍,TODO:调试时的大小,size_scale=0.04e2 bodies = [ sun, Mercury(name="水星", size_scale=1.5e3), # 水星 Venus(name="金星", size_scale=1e3), # 金星 Earth(name="地球", texture="earth_hd.jpg", - size_scale=1e3), # 地球 TODO:调试时的大小,size_scale=10e3 + size_scale=10e3), # 地球 TODO:调试时的大小,size_scale=10e3 # Earth(name="地球云层", # texture="transparent_clouds.png", # size_scale=1.01e3), # 地球云层 TODO:调试时的大小,size_scale=10.1e3 @@ -228,8 +228,6 @@ if __name__ == '__main__': # 日期是当年的第几天 timetuple = dt.timetuple() - day_of_year = timetuple.tm_yday - # 计算出:日期当天的偏转角度 - 贴图的误差 # angle_of_day = day_of_year * (360 / 365) - 93.5 # 2023.7.25 # angle_of_day = day_of_year * (360 / 365) - 60 # 2023.7.27 @@ -237,8 +235,9 @@ if __name__ == '__main__': # earth.planet.rotation_y = -(time_data.total_hours) * 15 - angle_of_day # 计算出:日期当天的偏转角度 + day_of_year = timetuple.tm_yday angle_of_day = day_of_year * (360 / 365) - total_hours = timetuple.tm_hour + timetuple.tm_min / 60 # + timetuple.tm_sec / 60 / 60 + total_hours = timetuple.tm_hour + timetuple.tm_min / 60 + timetuple.tm_sec / 60 / 60 earth.planet.rotation_y = -total_hours * 15 - angle_of_day # if len(in_line_datetimes) == 0: -- GitLab