forked from sergev/linkit-cube-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyramid.c
107 lines (88 loc) · 2.33 KB
/
pyramid.c
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#include "cube.h"
static void zoom_pyramid(int delay)
{
fill(0);
box_walls(0, 0, 0, 7, 0, 7);
delay_ms(delay);
fill(0);
box_wireframe(0, 0, 0, 7, 0, 1);
box_walls(0, 1, 0, 7, 1, 7);
delay_ms(delay);
fill(0);
box_wireframe(0, 0, 0, 7, 1, 1);
box_wireframe(1, 1, 2, 6, 1, 3);
box_walls(0, 2, 0, 7, 2, 7);
delay_ms(delay);
fill(0);
box_wireframe(0, 0, 0, 7, 2, 1);
box_wireframe(1, 1, 2, 6, 2, 3);
box_wireframe(2, 2, 4, 5, 2, 5);
box_walls(0, 3, 0, 7, 3, 7);
delay_ms(delay);
fill(0);
box_wireframe(0, 0, 0, 7, 3, 1);
box_wireframe(1, 1, 2, 6, 3, 3);
box_wireframe(2, 2, 4, 5, 3, 5);
box_wireframe(3, 3, 6, 4, 3, 7);
box_walls(0, 4, 0, 7, 4, 7);
delay_ms(delay);
fill(0);
box_wireframe(0, 0, 0, 7, 4, 1);
box_wireframe(1, 1, 2, 6, 4, 3);
box_wireframe(2, 2, 4, 5, 4, 5);
box_wireframe(3, 3, 6, 4, 4, 7);
box_walls(0, 5, 0, 7, 5, 7);
delay_ms(delay);
fill(0);
box_wireframe(0, 0, 0, 7, 5, 1);
box_wireframe(1, 1, 2, 6, 5, 3);
box_wireframe(2, 2, 4, 5, 5, 5);
box_wireframe(3, 3, 6, 4, 4, 7);
box_walls(0, 6, 0, 7, 6, 7);
delay_ms(delay);
fill(0);
box_wireframe(0, 0, 0, 7, 6, 1);
box_wireframe(1, 1, 2, 6, 6, 3);
box_wireframe(2, 2, 4, 5, 5, 5);
box_wireframe(3, 3, 6, 4, 4, 7);
box_walls(0, 7, 0, 7, 7, 7);
delay_ms(delay);
fill(0);
box_wireframe(0, 0, 0, 7, 7, 1);
box_wireframe(1, 1, 2, 6, 6, 3);
box_wireframe(2, 2, 4, 5, 5, 5);
box_wireframe(3, 3, 6, 4, 4, 7);
}
static void zoom_pyramid_clear(int delay)
{
box_walls(0, 0, 0, 7, 0, 7);
delay_ms(delay);
box_wireframe(0, 0, 0, 7, 0, 1);
clrplane(AXIS_Y, 0);
delay_ms(delay);
clrplane(AXIS_Y, 1);
box_walls(0, 2, 0, 7, 2, 7);
delay_ms(delay);
clrplane(AXIS_Y, 2);
box_walls(0, 3, 0, 7, 3, 7);
delay_ms(delay);
clrplane(AXIS_Y, 3);
box_walls(0, 4, 0, 7, 4, 7);
delay_ms(delay);
clrplane(AXIS_Y, 4);
box_walls(0, 5, 0, 7, 5, 7);
delay_ms(delay);
clrplane(AXIS_Y, 5);
box_walls(0, 6, 0, 7, 6, 7);
delay_ms(delay);
clrplane(AXIS_Y, 6);
box_walls(0, 7, 0, 7, 7, 7);
delay_ms(delay);
clrplane(AXIS_Y, 7);
}
void effect_zoom_pyramid(int delay)
{
zoom_pyramid(delay);
delay_ms(10*delay);
zoom_pyramid_clear(delay);
}