summaryrefslogtreecommitdiff
path: root/tomorrowthegroundGUI
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2012-05-01 12:16:00 +0100
committerTim Redfern <tim@eclectronics.org>2012-05-01 12:16:00 +0100
commitbe1dd58124b3b4e1ad7a9eeabfb421d246b6ad1b (patch)
treebbb8eaec0f9b2e62bbc01767ab24f20f998bce67 /tomorrowthegroundGUI
initial commit
Diffstat (limited to 'tomorrowthegroundGUI')
-rw-r--r--tomorrowthegroundGUI/data/gentmap.pngbin0 -> 206526 bytes
-rw-r--r--tomorrowthegroundGUI/tomorrowthegroundGUI.pde41
2 files changed, 41 insertions, 0 deletions
diff --git a/tomorrowthegroundGUI/data/gentmap.png b/tomorrowthegroundGUI/data/gentmap.png
new file mode 100644
index 0000000..4233f5f
--- /dev/null
+++ b/tomorrowthegroundGUI/data/gentmap.png
Binary files differ
diff --git a/tomorrowthegroundGUI/tomorrowthegroundGUI.pde b/tomorrowthegroundGUI/tomorrowthegroundGUI.pde
new file mode 100644
index 0000000..b784b99
--- /dev/null
+++ b/tomorrowthegroundGUI/tomorrowthegroundGUI.pde
@@ -0,0 +1,41 @@
+import hypermedia.net.*;
+
+PImage bgmap;
+UDP udp;
+int x,y;
+float lat1,lng1,lat2,lng2,fw,fh;
+
+void setup()
+{
+ bgmap = loadImage("gentmap.png");
+ size(bgmap.width,bgmap.height);
+ frameRate(30);
+ udp = new UDP(this);
+ x=width/2;
+ y=height/2;
+ lat1=51.050608;
+ lng1=3.724698;
+ lat2=51.046878;
+ lng2=3.732852;
+ fw=lng2-lng1;
+ fh=lat1-lat2;
+}
+
+void draw()
+{
+ background(bgmap);
+ fill(255);
+ stroke(255,0,0);
+ ellipse(x,y,5,5);
+}
+
+void mouseDragged()
+{
+ if (mousePressed) {
+ x=mouseX;
+ y=mouseY;
+ float fx=((float)mouseX)/width;
+ float fy=((float)mouseY)/height;
+ udp.send(((fx*fw)+lng1)+","+((fy*fh)+lat2)+"\n","127.0.0.1",5204);
+ }
+}