-
Notifications
You must be signed in to change notification settings - Fork 15
/
rotozoom.py
44 lines (40 loc) · 1.14 KB
/
rotozoom.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
#
# HZV ROTOZOOM
# tixlegeek 2024 - tixlegeek@cyberpunk.company
#
import random
import sys
import numpy as np
import pygame
from pharmacontroller import SCREEN_SIZE, PharmaScreen
size = 48
t=0
hzv = [
[0,0,0,0,0,0,0,0,0],
[0,0,1,1,1,1,1,0,0],
[0,1,0,0,1,1,1,1,0],
[0,1,0,0,1,0,0,1,0],
[0,1,1,1,1,1,1,1,0],
[0,0,1,1,1,1,1,0,0],
[0,0,1,0,1,0,1,0,0],
[0,0,0,0,0,0,0,0,0],
]
if __name__ == "__main__":
pygame.init()
screen = PharmaScreen()
matrix = np.zeros((size, size), dtype=float)
screen.set_image(matrix.tolist())
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
# Randomize the values of 10 pixels
t=t+1
for i in range(size):
for j in range(size):
x = ( (i-24) * np.cos(t/10) - (j-24) * np.sin(t/10)) / ((np.sin(t/20)*3)+4)+4
y = ( (j-24) * np.cos(t/10) + (i-24) * np.sin(t/10)) / ((np.sin(t/20)*3)+4)+4
matrix[i][j] = hzv[int(x)%8][int(y)%9]
screen.set_image(matrix.tolist())