←
Back to games
● OK 0 shapes
push
pop
translate(x,y)
scale(x,y)
rotate(rad)
drawSquare()
for i in range(n)
end
pi
sin(x)
cos(x)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Matrix stack pushes to the right
push
drawSquare
()
scale
(
0.5
,
0.5
)
for
i
in
range
(
4
)
push
translate
(
6
*
cos
(
pi
/
4
* i),
6
*
sin
(
pi
/
4
* i))
rotate
(
pi
/
4
* i)
scale
(
0.85
,
0.85
)
drawSquare
()
pop
end
pop
# Matrix stack pushes to the right push drawSquare() scale(0.5, 0.5) for i in range(4) push translate(6 * cos(pi / 4 * i), 6 * sin(pi / 4 * i)) rotate(pi / 4 * i) scale(0.85, 0.85) drawSquare() pop end pop
VIEWPORT
512×512px · MV stack · 2D canvas