From be1dd58124b3b4e1ad7a9eeabfb421d246b6ad1b Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 1 May 2012 12:16:00 +0100 Subject: initial commit --- tomorrowthegroundGUI/data/gentmap.png | Bin 0 -> 206526 bytes tomorrowthegroundGUI/tomorrowthegroundGUI.pde | 41 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 tomorrowthegroundGUI/data/gentmap.png create mode 100644 tomorrowthegroundGUI/tomorrowthegroundGUI.pde (limited to 'tomorrowthegroundGUI') diff --git a/tomorrowthegroundGUI/data/gentmap.png b/tomorrowthegroundGUI/data/gentmap.png new file mode 100644 index 0000000..4233f5f Binary files /dev/null and b/tomorrowthegroundGUI/data/gentmap.png 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); + } +} -- cgit v1.2.3