commit 32b9237a80d01efa9789251cf76c0dcb5b11c666 Author: Victor Giers Date: Thu Jan 3 21:38:57 2019 +0100 initial commit diff --git a/citizen.pde b/citizen.pde new file mode 100644 index 0000000..9be3a46 --- /dev/null +++ b/citizen.pde @@ -0,0 +1,100 @@ +/*asd*/ +import gab.opencv.*; + + +OpenCV opencv; + +PImage img_streets; +PImage img_houses; +PGraphics pg_map; + +boolean b_isRaining; + +class Citizen{ + int i_xSpawn, i_ySpawn, i_xPos, i_yPos; + String s_clan; + + Citizen(){ + + } + void spawn(){ + i_xSpawn = int(random(0,width)); + i_ySpawn = int(random(0,height)); + i_xPos = i_xSpawn; + i_yPos = i_ySpawn; + + //if(random(0,1) > .5) + + // berufsfeld: webdesigner, pädagoge, schmuckdesigner, schmied + // berufsstatus: beamter, selbstständiger, unternehmer, angestellter, grundschüler, gymnasiast, hauptschüler, realschüler, azubi, student, rentner + + // identität: gelbhemd, lokal, regional, national, international, fremd, + + } + void update(){ + + } + void display(){ + + } +} + +Citizen mensch; + +//distributionArea = + +void setup(){ + size(777,777); + textSize(30); + fill(0); + + opencv = new OpenCV( this ); + + img_streets = loadImage(dataPath("map/streets.png")); + img_houses = loadImage(dataPath("map/houses_with_borders.png")); + + surface.setResizable(true); + surface.setSize(img_streets.width,img_streets.height); + + blendMode(MULTIPLY); + + + generate_Spawns(); + + + mensch = new Citizen(); + mensch.spawn(); +} + +SpawnArea[] spawnAreas; + +class SpawnArea{ + //simplified hull? + + SpawnArea(){ + + } +} + +void generate_Spawns(){ + img_houses.loadPixels(); + //needs proper blob-detection + for(int y = 0; y < img_houses.height; y++){ + for(int x = 0; x < img_houses.width; x++){ + float r = red(img_houses.pixels[(y*img_houses.width)+x]); + if(r == 187) point(x, y); + } + } + + img_houses.updatePixels(); +} + +void draw(){ + background(255); + image(img_streets,0,0,img_streets.width, img_streets.height); + image(img_houses,0,0,img_houses.width, img_houses.height); + + mensch.update(); + + text(int(frameRate),0,30); +} diff --git a/data/map/gmynd_map_abstract-houses_and_streets.xcf b/data/map/gmynd_map_abstract-houses_and_streets.xcf new file mode 100644 index 0000000..98c06c5 Binary files /dev/null and b/data/map/gmynd_map_abstract-houses_and_streets.xcf differ diff --git a/data/map/houses_borders_only.png b/data/map/houses_borders_only.png new file mode 100644 index 0000000..731c3dd Binary files /dev/null and b/data/map/houses_borders_only.png differ diff --git a/data/map/houses_with_borders.png b/data/map/houses_with_borders.png new file mode 100644 index 0000000..38e5bf9 Binary files /dev/null and b/data/map/houses_with_borders.png differ diff --git a/data/map/houses_without_borders.png b/data/map/houses_without_borders.png new file mode 100644 index 0000000..5d75f62 Binary files /dev/null and b/data/map/houses_without_borders.png differ diff --git a/data/map/streets.png b/data/map/streets.png new file mode 100644 index 0000000..35c5012 Binary files /dev/null and b/data/map/streets.png differ diff --git a/data/map/streets_and_houses.png b/data/map/streets_and_houses.png new file mode 100644 index 0000000..9e8f90b Binary files /dev/null and b/data/map/streets_and_houses.png differ diff --git a/tools/mapstyle.withgoogle.com_roads_only_style_template.json b/tools/mapstyle.withgoogle.com_roads_only_style_template.json new file mode 100644 index 0000000..879c01f --- /dev/null +++ b/tools/mapstyle.withgoogle.com_roads_only_style_template.json @@ -0,0 +1 @@ +[ { "elementType": "geometry", "stylers": [ { "color": "#242f3e" }, { "visibility": "off" } ] }, { "elementType": "labels.text.fill", "stylers": [ { "color": "#746855" }, { "visibility": "off" } ] }, { "elementType": "labels.text.stroke", "stylers": [ { "color": "#242f3e" }, { "visibility": "off" } ] }, { "featureType": "administrative.locality", "elementType": "labels.text.fill", "stylers": [ { "color": "#d59563" } ] }, { "featureType": "landscape.man_made", "elementType": "geometry.fill", "stylers": [ { "color": "#ffffff" }, { "visibility": "off" } ] }, { "featureType": "landscape.man_made", "elementType": "geometry.stroke", "stylers": [ { "visibility": "on" } ] }, { "featureType": "poi", "stylers": [ { "visibility": "off" } ] }, { "featureType": "poi", "elementType": "labels.text.fill", "stylers": [ { "color": "#d59563" } ] }, { "featureType": "road", "stylers": [ { "visibility": "on" } ] }, { "featureType": "road", "elementType": "geometry", "stylers": [ { "color": "#000000" } ] }, { "featureType": "road", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road", "elementType": "labels.text.fill", "stylers": [ { "color": "#9ca5b3" } ] }, { "featureType": "road.arterial", "elementType": "geometry.stroke", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road.arterial", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road.arterial", "elementType": "labels.text", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road.highway", "stylers": [ { "visibility": "on" } ] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [ { "color": "#746855" } ] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [ { "color": "#000000" }, { "visibility": "off" } ] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road.highway", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road.highway", "elementType": "labels.text", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road.local", "elementType": "geometry.stroke", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road.local", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road.local", "elementType": "labels.text", "stylers": [ { "visibility": "off" } ] }, { "featureType": "transit", "elementType": "geometry", "stylers": [ { "color": "#2f3948" } ] }, { "featureType": "transit", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "transit.line", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "transit.station", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "transit.station", "elementType": "labels.text.fill", "stylers": [ { "color": "#d59563" } ] }, { "featureType": "water", "elementType": "geometry", "stylers": [ { "color": "#17263c" } ] }, { "featureType": "water", "elementType": "labels.text.fill", "stylers": [ { "color": "#515c6d" } ] }, { "featureType": "water", "elementType": "labels.text.stroke", "stylers": [ { "color": "#17263c" } ] } ]