-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
117 lines (85 loc) · 2.87 KB
/
main.py
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
'''
Universidad del Valle de Guatemala
Gráficas por computadora
Christopher García 20541
2do. ciclo 2022
'''
from gl import *
from colors import *
from shapes import *
from textures import Texture
r = Render(1024, 1024)
t = Texture('./Models_And_Textures/Books2.bmp')
r.framebuffer = t.pixels
# Dragon ---------------------------------------------------------
t = Texture('./Models_And_Textures/Dragon.bmp')
r.active_texture = t
r.active_shader = r.shader
r.lookAt(V3(0, 0, 5), V3(0, 0, 0), V3(0, 1, 0))
s = (3, 3, 3)
tf = (510, 440, 0)
rot = (0, 0, 0)
load_model(r, './Models_And_Textures/Dragon.obj', tf, s, rot)
draw(r, 'TRIANGLEST')
# Cyborg ---------------------------------------------------------
t = Texture('./Models_And_Textures/helmet.bmp')
r.active_texture = t
r.active_shader = r.shader
r.lookAt(V3(0, 0, 5), V3(0, 0, 0), V3(0, 1, 0))
s = (7,7,7)
tf = (512, 740, 0)
rot = (0, 0, 0)
load_model(r, './Models_And_Textures/helmet_clean.obj', tf, s, rot)
draw(r, 'TRIANGLEST')
# Steam Deck ---------------------------------------------------------
t = Texture('./Models_And_Textures/Steam.bmp')
r.active_texture = t
r.active_shader = r.shader
r.lookAt(V3(0, 0, 5), V3(0, 0, 0), V3(0, 1, 0))
s = (19, 19, 19)
tf = (275, 410, 0)
rot = (-1, 0, 0)
load_model(r, './Models_And_Textures/Steam.obj', tf, s, rot)
draw(r, 'TRIANGLEST')
# Bus ---------------------------------------------------------
t = Texture('./Models_And_Textures/Bus.bmp')
r.active_texture = t
r.active_shader = r.shader
r.lookAt(V3(0, 0, 5), V3(0, 0, 0), V3(0, 1, 0))
s = (135, 135, 135)
tf = (510, 185, 0)
rot = (0.5, 20, 0)
load_model(r, './Models_And_Textures/Bus.obj', tf, s, rot)
draw(r, 'TRIANGLEST')
t = Texture('./Models_And_Textures/Bus.bmp')
r.active_texture = t
r.active_shader = r.shader
r.lookAt(V3(0, 0, 5), V3(0, 0, 0), V3(0, 1, 0))
s = (60, 60, 60)
tf = (465, 145, 0)
rot = (0.6, -20, 0)
load_model(r, './Models_And_Textures/Bus.obj', tf, s, rot)
draw(r, 'TRIANGLEST')
# Tenis ---------------------------------------------------------
t = Texture('./Models_And_Textures/nb574.bmp')
r.active_texture = t
r.active_shader = r.shader
r.lookAt(V3(0.6, -12, 5), V3(0, 0, 0), V3(0, 1, 0))
s = (25, 25, 25)
tf = (770, 250, 0)
rot = (0, 0, 5)
load_model(r, './Models_And_Textures/nb574.obj', tf, s, rot)
draw(r, 'TRIANGLEST')
# Velero ---------------------------------------------------------
t = Texture('./Models_And_Textures/veliero.bmp')
r.active_texture = t
r.active_shader = r.shader
r.lookAt(V3(0, 0, 5), V3(0, 0, 0), V3(0, 1, 0))
s = (20, 20, 20)
tf = (650, 632, 0)
rot = (5, 0, 0)
load_model(r, './Models_And_Textures/veliero.obj', tf, s, rot)
draw(r, 'TRIANGLEST')
# Fin ---------------------------------------------------------
r.write("Scene.bmp")
print("Escena creada con éxito")