diff --git a/simulators/ursina/entities/ursina_demo.py b/simulators/ursina/entities/ursina_demo.py index 05507db5321431fd6e9a6480a11b36a5417601ac..5e17014d80285cad9b924262afeefed05db25cc2 100644 --- a/simulators/ursina/entities/ursina_demo.py +++ b/simulators/ursina/entities/ursina_demo.py @@ -1,4 +1,5 @@ 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()