-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
43 lines (31 loc) · 973 Bytes
/
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
import pygame
from pygame import Color
from classes.Camera import Camera
from classes.Mesh import Mesh
from utils.types import Position, Scaling
pygame.init()
screen_width = 1920
screen_height = 1080
screen = pygame.display.set_mode((screen_width, screen_height))
clock = pygame.time.Clock()
running = True
mesh = Mesh('cube.obj', scale=Scaling(0.5, 0.5, 0.5))
print(mesh)
camera: Camera = Camera(pos=Position(0, 0, -4))
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.fill("black")
mesh.rot.y = mesh.rot.y + 1
camera.rot.y = camera.rot.y + 1
# mesh.pos.z += 1
# camera.pos.z -= 1
# mesh.pos.x = mesh.pos.x + 0.01
mesh.draw(camera)
# pygame.draw.circle(screen, Color(255, 255, 255), (screen.get_width() / 2, screen.get_height() / 2), 5)
pygame.display.flip()
clock.tick(60)
# clock.tick()
# print('fps:', clock.get_fps())
pygame.quit()