commit 13c405aa186d64ab0e3c7322b2d6fb92c99f01bb Author: linlyboi Date: Wed Mar 13 02:11:37 2024 +0200 The beginning of the mapLoad diff --git a/mapLoad/coords.csv b/mapLoad/coords.csv new file mode 100644 index 0000000..7c47c2e --- /dev/null +++ b/mapLoad/coords.csv @@ -0,0 +1,6 @@ +lng,ltd,balls, +5,5,help +15,25,help +25,45,help +35,65,help +45,85,help diff --git a/mapLoad/map.png b/mapLoad/map.png new file mode 100644 index 0000000..59fbcf3 Binary files /dev/null and b/mapLoad/map.png differ diff --git a/mapLoad/mapLoad.pde b/mapLoad/mapLoad.pde new file mode 100644 index 0000000..7c7b036 --- /dev/null +++ b/mapLoad/mapLoad.pde @@ -0,0 +1,38 @@ +/** + * Background Image. + * + * This example presents the fastest way to load a background image + * into Processing. To load an image as the background, it must be + * the same width and height as the program. + */ + +PImage bg; +Table coords; +int y; +int dotWidth; +int dotHeight; +void setup() { + size(1280, 726); + dotWidth = 4; + dotHeight = 4; + // The background image must be the same size as the parameters + // into the size() method. In this program, the size of the image + // is 640 x 360 pixels. + bg = loadImage("map.png"); + coords = loadTable("coords.csv", "header"); //"header" if the table has header row +} + +void draw() { + background(bg); + loadData(); +} + +void loadData() { + + for (TableRow row : coords.rows()) { + float lng = row.getFloat("lng"); //value accessed by column name or index + float ltd = row.getFloat("ltd"); + ellipse(lng, ltd, dotWidth, dotHeight); + + } +}