Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ursina import *
- def update():
- for i in l:
- i.rotation_y += 2
- def input(key):
- if key == '1':
- camera.position=(0,0,-20)
- camera.rotation_x = 0
- if key == '2':
- camera.position=(0,20,0)
- camera.rotation_x = 90
- if key == '3':
- camera.position=(0,10,-17)
- camera.rotation_x = 30
- app = Ursina()
- sun = Entity(model="sphere", color=color.yellow, scale=2, texture='sun.jpg')
- earth = Entity(parent=sun, model="sphere", scale=0.4, position=(1,0,1), texture='earth.jpg')
- moon = Entity(parent=earth, model="sphere", scale=0.3, position=(0.5,0,0.5), color=color.white)
- l = [sun, earth, moon]
- app.run()
Advertisement
Add Comment
Please, Sign In to add comment