-
Notifications
You must be signed in to change notification settings - Fork 1
/
lec06-22.json
77 lines (75 loc) · 2.24 KB
/
lec06-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
[
{
"title": "Scale about a 45 degrees Axis",
"transformations":
[
["fillRect", -10, -10, 20, 20, "darkred"],
["rotate", 45],
["scale", 2, 1],
["rotate", -45],
["fillRect", -10, -10, 20, 20, "#F0000080"]
]
},
{
"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": "Unbent Arm",
"transformations":
[
["fillRect", 0, 0, 20, 10, "purple"],
["translate", 20, 0],
["fillRect", 0, 0, 20, 10, "blue"],
["translate", 20, 0],
["fillRect", 0, 0, 10, 10, "green"]
]
},
{
"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"]
]
}
]