-
Notifications
You must be signed in to change notification settings - Fork 1
/
lec05-22.json
168 lines (167 loc) · 4.46 KB
/
lec05-22.json
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
[
{
"title": "Same Square, 2 Ways, Not Centered",
"transformations": [
["fillRect",20,20,20,20,"blue"],
["translate",20,20],
["fillRect",0,0,20,20,"red"]
]
},
{
"title" : "triangles with translation",
"transformations" : [
["triangle",0,0,"red"],
["translate",20,0],
["triangle",0,0,"blue"],
["translate",0,20],
["triangle",0,0,"green"]
]
},
{
"title" : "triangles with save/restore",
"transformations" : [
["triangle",0,0,"red"],
["save"],
["translate",20,0],
["triangle",0,0,"blue"],
["restore"],
["save"],
["translate",20,20],
["triangle",0,0,"green"],
["restore"]
]
},
{
"title": "Simple Scale",
"transformations": [
["scale",2,2],
["fillRect",0,0,20,20,"red"]
]
},
{
"title": "Multiple Simple Scales",
"transformations": [
["scale",4,4],
["fillRect",0,0,10,10,"blue"],
["scale",0.5,0.5],
["fillRect",0,0,10,10,"red"]
]
},
{
"title": "Scale not at origin",
"transformations": [
["scale",2,2],
["fillRect",10,10,10,10,"blue"]
]
},
{
"title": "Translate then scale",
"transformations": [
["translate",20,20],
["scale",2,2],
["fillRect",0,0,10,10,"red"]
]
},
{
"title": "Scale then translate",
"transformations": [
["scale",2,2],
["translate",20,20],
["fillRect",0,0,10,10,"red"]
]
},
{
"title": "Compare Scale/Trans with Trans/Scale",
"transformations": [
["save"],
["translate",20,20],
["scale",2,2],
["fillRect",0,0,10,10,"blue"],
["restore"],
["scale",2,2],
["translate",20,20],
["fillRect",0,0,10,10,"red"]
]
},
{
"title": "Center of Scaling",
"transformations": [
["fillRect",10,10,20,20,"red"],
["translate",20,20],
["scale",2,2],
["translate",-20,-20],
["fillRect",10,10,20,20,"#0000FF80"]
]
},
{
"title": "Rotate (1 object)",
"transformations" : [
["rotate",45],
["fillRect",0,0,20,20,"red"]
]
},
{
"title": "Rotate (2 objects)",
"transformations" : [
["fillRect",-10,-10,20,20,"#FF000080"],
["fillRect", 40,-10,20,20,"#0000FF80"],
["rotate",45],
["fillRect",-10,-10,20,20,"#FF000080"],
["fillRect", 40,-10,20,20,"#0000FF80"]
]
},
{
"title": "Rotate about object center",
"transformations":
[
["fillRect", 20, 20, 40, 40, "red"],
["translate", 40, 40],
["rotate", 45],
["translate", -40, -40],
["fillRect", 20, 20, 40, 40, "blue"]
]
},
{
"title": "Rotate (2 objects) around centers",
"transformations" : [
["save"],
["fillRect",-10,-10,20,20,"#FF000080"],
["rotate",45],
["fillRect",-10,-10,20,20,"#FF000080"],
["restore"],
["save"],
["fillRect", 40,-10,20,20,"#0000FF80"],
["translate",50,0],
["rotate",45],
["translate",-50,0],
["fillRect", 40,-10,20,20,"#0000FF80"],
["restore"]
]
},
{
"title": "Scale about a 45 degrees Axis",
"transformations":
[
["rotate", 45],
["scale", 2, 1],
["rotate", -45],
["fillRect", -10, -10, 20, 20, "#F0000080"]
]
},
{
"title": "Bend an arm 45 degrees at Elbow and Wrist",
"transformations":
[
["fillRect", 0, 0, 20, 10, "purple"],
["translate", 20, 0],
["rotate", 45],
["fillRect", 0, 0, 20, 10, "blue"],
["translate", 20, 0],
["rotate", 45],
["fillRect", 0, 0, 10, 10, "green"]
]
},
{
"title": "Your turn to play with it"
}
]