-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathstyle.py
23 lines (20 loc) · 815 Bytes
/
style.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""
When the main loop renders the point cloud, it calls a function for each point which returns a pygame.Surface.
Then every pygame.Surface object is rendered, the furthest ones are rendered first and the closest ones
are rendered last.
This module contains functions which can be called for each point. Each one must return pygame.Surface
and takes a single point as a parameter. A point is represented by a list: [X, Y, Z, [Red, Green, Blue]].
"""
import pygame
def square(point) -> pygame.Surface:
"""
Draw a point as a colored square
"""
size = 2
alpha = 255
s = pygame.Surface((size, size))
s.set_alpha(alpha)
s.fill(point[3])
return s
# Function which will be called by the main program for every rendered points.
STYLE_FUNCTION = square