// imagemap -------------------------------------------------------------------- class vimage { PImage c; int[][] cPixels = new int[imgwidth][imgheight]; particle[][] p = new particle[imgwidth][imgheight]; float tt, tnum; String name; // init particles ------------------------------------------------------------ vimage() { for(int i=0; i 0) { switch (_mode) { // visualisation: points --------------------------------------------- case 1: switch (colormode) { case 1: stroke (255, 255, 255, 200); break; case 2: stroke(red(cPixels[i][j]), green(cPixels[i][j]), blue(cPixels[i][j])); break; case 3: stroke(red(img[count].imgPixels[j][i]), green(img[count].imgPixels[j][i]), blue(img[count].imgPixels[j][i])); break; } point(p[i][j].x, p[i][j].y, p[i][j].t); break; // visualisation: lines ---------------------------------------------- case 2: switch (colormode) { case 1: stroke (255, 255, 255, 50); break; case 2: stroke(red(cPixels[i][j]), green(cPixels[i][j]), blue(cPixels[i][j]), 200); break; case 3: stroke(red(img[count].imgPixels[j][i]), green(img[count].imgPixels[j][i]), blue(img[count].imgPixels[j][i]), 200); break; } if (count < img_num - 1) { tnum = img[count + 1].imgColors[j][i] * d; } else { tnum = img[0].imgColors[j][i] * d; } if (abs(tt - tnum) > 0.01) { tt -= (tt - tnum)/2.0; } line(p[i][j].x, p[i][j].y, p[i][j].t, p[i][j].x, p[i][j].y, tt); break; // visualisation: cubes ---------------------------------------------- case 3: rectMode(CORNER); switch (colormode) { case 1: fill(255, 255, 255, 30); stroke (255, 255, 255, 50); break; case 2: fill(red(cPixels[i][j]), green(cPixels[i][j]), blue(cPixels[i][j])); stroke(0, 50); break; case 3: fill(red(img[count].imgPixels[j][i]), green(img[count].imgPixels[j][i]), blue(img[count].imgPixels[j][i])); stroke(0, 50); break; } pushMatrix(); translate(p[i][j].x, p[i][j].y, p[i][j].t); box(res-2); popMatrix(); break; // visualisation: graph ---------------------------------------------- case 4: rectMode(CORNER); switch (colormode) { case 1: fill(255, 255, 255, 30); stroke (255, 255, 255, 50); break; case 2: fill(red(cPixels[i][j]), green(cPixels[i][j]), blue(cPixels[i][j])); stroke(0, 50); break; case 3: fill(red(img[count].imgPixels[j][i]), green(img[count].imgPixels[j][i]), blue(img[count].imgPixels[j][i])); stroke(0, 50); break; } pushMatrix(); translate(p[i][j].x, p[i][j].y, p[i][j].t/2); box(res-2, res-2, p[i][j].t); popMatrix(); break; // visualisation: typography ----------------------------------------- case 5: noStroke(); switch (colormode) { case 1: fill(255, 255, 255, 100); break; case 2: fill(red(cPixels[i][j]), green(cPixels[i][j]), blue(cPixels[i][j]), 200); break; case 3: fill(red(img[count].imgPixels[j][i]), green(img[count].imgPixels[j][i]), blue(img[count].imgPixels[j][i]), 200); break; } textFont(univers, 8); textAlign(LEFT); pushMatrix(); translate(p[i][j].x, p[i][j].y, p[i][j].t/2); pushMatrix(); rotateX(-rxnum); text(int(p[i][j].t * (max - min)/255) + min, 0, 0); popMatrix(); popMatrix(); break; } } } } } // vertexmap ----------------------------------------------------------------- void vertexmap(boolean _texture) { colorMode(RGB, 255); switch (colormode) { case 1: fill(255, 0); stroke(255, 50); break; case 2: fill(255); stroke(0, 50); break; case 3: fill(255); stroke(0, 50); break; } for(int i=0; i=imgmargin; j-=res) { int i = imgwidth - 1; vertex(p[i][j].x, p[i][j].y, p[i][j].t); } // top for(int i=0; i 0.01) { t -= (t-tn)/2.0; }; } void render(int _count) { colorMode(RGB, 255); stroke(255); point(x, y, t); } } }