目录
- from ursina import *
-
- def update():
- cube.x = cube.x+time.dt
- # cube.x = cube.x+time.dt*0.5 # 速度为之前的0.5倍
-
- app = Ursina()
- cube = Entity(model="cube", color=color.red)
- app.run()
- from ursina import *
-
- def update():
- cube.x = cube.x + time.dt
- cube.y = cube.y + time.dt
-
- app = Ursina()
- cube = Entity(model="cube", color=color.red)
- app.run()
效果:
- from ursina import *
-
- def update():
- cube.rotation_x = cube.rotation_x + time.dt*100 # 沿x轴旋转
-
- app = Ursina()
- cube = Entity(model="cube", color=color.red)
- app.run()
效果:
- from ursina import *
-
- def update():
- cube.x = cube.x + time.dt
- cube.rotation_z = cube.rotation_z+time.dt*100
-
- app = Ursina()
- cube = Entity(model="cube", color=color.red)
- app.run()
效果:
- from ursina import *
- from random import randint
-
- def update():
- R = randint(0, 255)
- G = randint(0, 255)
- B = randint(0, 255)
- cube.color=color.rgb(R,G,B)
- cube.y = cube.y + time.dt
- cube.rotation_x=cube.rotation_x+time.dt*100
- cube.rotation_y = cube.rotation_y + time.dt * 100
-
- app = Ursina()
- cube = Entity(model="cube", color=color.red)
- app.run()
效果: