initial commit

This commit is contained in:
2019-01-03 21:38:57 +01:00
commit 32b9237a80
8 changed files with 101 additions and 0 deletions

100
citizen.pde Normal file
View File

@@ -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);
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
data/map/streets.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 KiB

View File

@@ -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" } ] } ]