-
Notifications
You must be signed in to change notification settings - Fork 4
/
gml.pde
40 lines (36 loc) · 1.31 KB
/
gml.pde
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
//-----------------------------------------------------------------------------------------
// Parse Blob Vertices to GML via xml file
void gml() {
if (detect == true) {
Blob b;
EdgeVertex gmlA,gmlB;
for (int n = 0 ; n < theBlobDetection.getBlobNb() ; n++) {
if (blbs[n] == true){
b = theBlobDetection.getBlob(n);
if (b!=null) {
for (int m = 0; m < b.getEdgeNb(); m++) {
gmlA = b.getEdgeVertexA(m);
gmlB = b.getEdgeVertexB(m);
if (gmlA != null && gmlB != null) {
if(export == true) {
frameRate(1);
// Subtract 1 to flip horizontal
Vec3D v = new Vec3D((float) 1 - gmlA.x, (float) gmlA.y, 0);
// <pt>v</pt> (add point tag)
recorder.addPoint(0, v, 0.1);
}
frameRate(30);
}
}
// </stroke> (End Stroke)
recorder.endStroke(0);
// <stroke layer="0"> (Start New Stroke)
GmlBrush brush = new GmlBrush();
brush.set(GmlBrush.UNIQUE_STYLE_ID, MeshDemo.ID);
recorder.beginStroke(0, 0, brush);
}
}
}
}
}
//-----------------------------------------------------------------------------------------