提交 228dc36b 编写于 作者: 三月三net's avatar 三月三net

太阳系三体模拟器

上级 74d56431
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# ============================================================================== # ==============================================================================
# pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com ursina # pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com ursina
from ursina import Ursina, window, Entity, Mesh, SmoothFollow, Texture, clamp, time, \ from ursina import Ursina, window, Entity, Mesh, SmoothFollow, Texture, clamp, time, \
camera, color, mouse, Vec2, Vec3, Vec4,\ camera, color, mouse, Vec2, Vec3, Vec4, \
load_texture, held_keys load_texture, held_keys
# from ursina.camera import OrthographicCamera # from ursina.camera import OrthographicCamera
...@@ -37,7 +37,6 @@ class UrsinaPlayer(FirstPersonController): ...@@ -37,7 +37,6 @@ class UrsinaPlayer(FirstPersonController):
""" """
body_rotation_speed_control = 1.0 body_rotation_speed_control = 1.0
def __init__(self, position, targets=None): def __init__(self, position, targets=None):
super().__init__() super().__init__()
camera.fov = 100 camera.fov = 100
...@@ -164,18 +163,19 @@ class UrsinaView(BodyView): ...@@ -164,18 +163,19 @@ class UrsinaView(BodyView):
创建行星环(使用土星贴图) 创建行星环(使用土星贴图)
:return: :return:
""" """
# # # 行星环偏移角度 # 行星环偏移角度
# self.ring_rotation_x = 80 # self.ring_rotation_x = 80
# # 创建行星环 # 创建行星环
# self.ring = Entity(parent=self.planet, model='circle', texture='../textures/saturnRings.jpg', scale=3.5, # self.ring = Entity(parent=self.planet, model='circle', texture='../textures/saturnRings.jpg', scale=3.5,
# rotation=(self.ring_rotation_x, 0, 0), double_sided=True) # rotation=(self.ring_rotation_x, 0, 0), double_sided=True)
# 行星环偏移角度
self.ring_rotation_x = 0 self.ring_rotation_x = 0
torus = create_body_torus(0.3, 1, 32) # 创建行星环
torus = create_body_torus(0.3, 1, 64)
self.ring = Entity(parent=self.planet, model=torus, texture='../textures/saturnRings.jpg', scale=1, self.ring = Entity(parent=self.planet, model=torus, texture='../textures/saturnRings.jpg', scale=1,
rotation=(self.ring_rotation_x, 0, 0), double_sided=True) rotation=(self.ring_rotation_x, 0, 0), double_sided=True)
# 设置行星环不受灯光影响,否则看不清行星环 # 设置行星环不受灯光影响,否则看不清行星环
self.ring.set_light_off() self.ring.set_light_off()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册