-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrender.py
67 lines (49 loc) · 1.2 KB
/
render.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
"""渲染函数模块
这个文件是你参赛时使用的、允许修改的文件。
分别在 `rd` `gr` `bl` 里填写你的渲染函数。
渲染时,会在同一像素位置 (x, y) 上分别调用
这三个函数获取像素位置的颜色 (R, G, B)。
"""
from math import *
from handy_math import *
FPS = 25
FPS_INV = 1.0 / FPS
TMAX = 6.0
DIM = 512
DM1 = (DIM - 1)
# image size
N = DIM
N1 = DIM - 1
def rd(x: int, y: int, t: float) -> int:
"""像素红色
参数:
x (int): x 坐标
y (int): y 坐标
t (float): 时间 (单位:秒)
返回值:
int: 红色值 (0-255)
"""
# 在这里填写你的代码
return 0
def gr(x: int, y: int, t: float) -> int:
"""像素绿色
参数:
x (int): x 坐标
y (int): y 坐标
t (float): 时间 (单位:秒)
返回值:
int: 绿色值 (0-255)
"""
# 在这里填写你的代码
return 0
def bl(x: int, y: int, t: float) -> int:
"""像素蓝色
参数:
x (int): x 坐标
y (int): y 坐标
t (float): 时间 (单位:秒)
返回值:
int: 蓝色值 (0-255)
"""
# 在这里填写你的代码
return 0