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

Python超人-宇宙模拟器

上级 ae76a042
from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController
from sim_scenes.func import create_sphere_sky
......@@ -7,22 +8,45 @@ texture = load_texture("../../../objs/textures/core_valaga_clas.jpg")
camera_ship = Entity(model="../../../objs/models/core_valaga_clas.obj",
texture=texture, double_sided=True)
shperes = []
def create_sphere():
shpere = Entity(model="sphere", position=camera_ship.position, scale=30)
shperes.append(shpere)
# camera.parent = camera_ship.planet
# camera.reparent_to(camera_ship.planet)
# camera.scale = 100
camera.fov = 60
camera.clip_plane_near = 0.01
# camera.clip_plane_near = 0.1
camera.clip_plane_far = 51000000
create_sphere_sky(scale=500000)
# camera.parent = camera_ship
create_sphere_sky(scale=5000000)
camera.parent = camera_ship
camera.reparent_to(camera_ship)
camera.position = [0, 1000, -1000]
camera.position = [0, 1000, -3000]
camera.rotation_x = 20
# application.time_scale = 1
def update():
camera_ship.position += Vec3(0,0,10)
camera.position = Vec3(0, 1000, -1000)
camera_ship.position += Vec3(0, 0, 10)
camera_ship.rotation_y += 0.01
# camera.position = Vec3(0, 1000, -1000)
for shpere in shperes:
shpere.position += Vec3(0, 0, 100)
shpere.rotation_y = camera_ship.rotation_y
def input(key):
print(key)
if key == "space":
create_sphere()
EditorCamera()
# player = FirstPersonController()
# EditorCamera()
app.run()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册