-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
50 lines (39 loc) · 1.02 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
import pygame
import math
import event
from Tools.matrix import *
from Tools.Objects.cube import Cube
from Tools.Objects.grid import GridPlane
from Tools.Vector import *
from Tools.utils import *
from Tools.constants import *
from Tools.camera import Camera
window = pygame.display.set_mode(Resolution)
#hide mouse
pygame.mouse.get_rel()
pygame.mouse.set_visible(False)
a = pygame.event.set_grab(True)
clock = pygame.time.Clock()
fps = 60
mx, my = 0, 0
m_wheel = { "changed" :False, "value" :0}
cam = Camera()
angle = 0
gridPlane = GridPlane(30)
gridPlane.color = (255, 255, 255)
gridPlane.transform = rotationX(-math.pi/2)
c = Cube()
run = True
while run:
clock.tick(fps)
window.fill(BackgroundColor)
#pygame.draw.rect(window, (50, 20, 120), pygame.Rect(300, 400, 200, 500))
#get events
run = event.GetEvent(mx, my, m_wheel, cam)
cam.HandleInput(m_wheel)
gridPlane.Draw(cam, window, False)
c.Draw(cam, window)
#angle += 0.005
m_wheel["changed"] = False
pygame.display.flip()
pygame.quit()