-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathcamera_controllers.py
More file actions
46 lines (38 loc) · 3.31 KB
/
camera_controllers.py
File metadata and controls
46 lines (38 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from mewnala import *
angle = 0.0
mode = 0
def setup():
size(800, 600)
mode_3d()
orbit_camera()
dir_light = create_directional_light((1.0, 0.98, 0.95), 1500.0)
dir_light.position(300.0, 400.0, 300.0)
dir_light.look_at(0.0, 0.0, 0.0)
def draw():
global angle, mode
if key_just_pressed(KEY_1):
mode_3d()
orbit_camera()
mode = 0
if key_just_pressed(KEY_2):
mode_3d()
free_camera()
mode = 1
if key_just_pressed(KEY_3):
mode_2d()
pan_camera()
mode = 2
background(13, 13, 18)
if mode < 2:
fill(255, 217, 145)
roughness(0.3)
metallic(0.8)
push_matrix()
rotate(angle)
box(100.0, 100.0, 100.0)
pop_matrix()
else:
fill(204, 77, 51)
rect(300.0, 200.0, 200.0, 200.0)
angle += 0.02
run()