Skip to content

Commit 28aa134

Browse files
committed
using UK map and doing some color cycling #167
1 parent 7c671ca commit 28aa134

3 files changed

Lines changed: 585 additions & 28 deletions

File tree

content/examples/Basics/Shape/ShapeVertices/ShapeVertices.pde

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,32 @@
1111
*/
1212

1313
// The shape
14-
PShape pentagram;
14+
PShape uk;
1515

1616
void setup() {
17-
size(600, 400);
18-
// Load teh shape
19-
pentagram = loadShape("pentagram.svg");
17+
size(640, 360);
18+
// Load the shape
19+
uk = loadShape("uk.svg");
2020
}
2121

2222
void draw() {
23-
background(0);
23+
background(51);
24+
// Center where we will draw all the vertices
25+
translate(width/2 - uk.width/2, height/2- uk.height/2);
26+
2427
// Iterate over the children
25-
int children = pentagram.getChildCount();
28+
int children = uk.getChildCount();
2629
for (int i = 0; i < children; i++) {
27-
PShape child = pentagram.getChild(i);
30+
PShape child = uk.getChild(i);
2831
int total = child.getVertexCount();
29-
// The vertices of each child
32+
33+
// Now we can actually get the vertices from each child
3034
for (int j = 0; j < total; j++) {
3135
PVector v = child.getVertex(j);
32-
stroke(255);
33-
strokeWeight(4);
34-
ellipse(v.x, v.y, 16, 16);
36+
// Cycling brightness for each vertex
37+
stroke((frameCount + (i+1)*j) % 255);
38+
// Just a dot for each one
39+
point(v.x, v.y);
3540
}
3641
}
37-
38-
/*
39-
// You could also get the "tessllation"
40-
// which is a single shape of all the vertices
41-
PShape tes = pentagram.getTessellation();
42-
int total = tes.getVertexCount();
43-
for (int j = 0; j < total; j++) {
44-
PVector v = tes.getVertex(j);
45-
point(v.x, v.y, v.z);
46-
}*/
4742
}

content/examples/Basics/Shape/ShapeVertices/data/pentagram.svg

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)