Mail.ruПочтаМой МирОдноклассникиВКонтактеИгрыЗнакомстваНовостиКалендарьОблакоЗаметкиВсе проекты

Как на Ursina сделать так чтобы при вращении башни камера смотрела туда куда смотрит башня танка? Python

Никита Документов Профи (976), на голосовании 1 месяц назад
нужно сделать так, чтобы камера смотрела в ту сторону куда смотрит пушка, ну вращение камеры за пушкой
 from ursina import *  

def update():
global rotation_gun
if held_keys['e']:
player.y+=0.05
if held_keys['q']:
player.y-=0.05
if held_keys['z']:
smoka.rotation_z+=1
if held_keys['x']:
smoka.rotation_z-=1

def input(key):
if key=='escape':
quit()

x = -11.2
y = 1.93
z = -5.3

x1 = 0
y1 = 3
z1 = 0

rotation_gun = 0

app = Ursina()

smoka = Entity(model='smokaM0.obj', scale=0.01, texture='Smoky_m0.png', position=(x1, y1, z1))
tank = Entity(model='Wasp_0123.obj', scale=0.01, texture='Wasp_0.jpg', position=(x, y, z))

camera.z = -10
camera.y = 5
camera.x = 0

camera.rotation_x = 10

landspace = Entity(model='cube', scale=(3, 0, 3), texture='grass3_3_3.jpg', position=(0, 0, 0))
landspace1 = Entity(model='cube', scale=(3, 0, 3), texture='grass3_3_3.jpg', position=(3, 0, 0))
landspace2 = Entity(model='cube', scale=(3, 0, 3), texture='grass3_3_3.jpg', position=(6, 0, 0))
landspace3 = Entity(model='cube', scale=(3, 0, 3), texture='grass3_3_3.jpg', position=(9, 0, 0))
landspace4 = Entity(model='cube', scale=(3, 0, 3), texture='grass3_3_3.jpg', position=(0, 0, 3))
landspace5 = Entity(model='cube', scale=(3, 0, 3), texture='grass3_3_3.jpg', position=(3, 0, 3))
landspace6 = Entity(model='cube', scale=(3, 0, 3), texture='grass3_3_3.jpg', position=(6, 0, 3))
smoka.rotation_x-=90
tank.rotation_x-=90
smoka.rotation_z-=180
tank.rotation_z-=180

sky = Entity(model='sphere', texture='skybox.png', scale=1000, double_sided=True)

app.run()
Голосование за лучший ответ
꧁Tester꧂ ︎ Мудрец (19136) 2 месяца назад
Ты думаешь кто-то ту пишет игры на Ursina или что?
Похожие вопросы