diff options
Diffstat (limited to 'vodaviz.pde')
| -rw-r--r-- | vodaviz.pde | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/vodaviz.pde b/vodaviz.pde index 70f6626..4ca3dbc 100644 --- a/vodaviz.pde +++ b/vodaviz.pde @@ -215,7 +215,7 @@ void setup(){ RG.init(this); mode="PDF"; - if (mode=="PDF") size(832,220,PDF, "vodaviz_circles_190212.pdf"); //P3D); //832,220); //nb pdf is 800x600 + if (mode=="PDF") size(832,220,PDF, "vodaviz_circles_200212.pdf"); //P3D); //832,220); //nb pdf is 800x600 else size(832,220); //,PDF, "testoutput.pdf"); //P3D); //832,220); //nb pdf is 800x600 // C. 33 - M. 3 - Y. 0 - K. 0 @@ -234,7 +234,7 @@ void setup(){ ptrans = new pointTransform(); smap = new sphereMap(); - lightmap=loadImage("vodaviz_bg_160212.png"); + lightmap=loadImage("earth_lights.gif"); float startsize=0.2; float endsize=0.1; @@ -312,7 +312,8 @@ void draw() { // //pick a random colour - fg=color(random(150)+10,random(150)+10,random(150)+10); + colorMode(HSB); + fg=color(random(255),255,150,50); //stroke(fg); noStroke(); fill(fg); @@ -364,16 +365,29 @@ void draw() { //println("plotting "+calls.countries.get(i).name+": "+calls.countries.get(i).calls+" calls"); } - if (true) { //draw gradient 3D lines + if (false) { //draw gradient 3D lines if (calls.countries.get(i).points.size()>0) { for (int j=0;j<log10(calls.countries.get(i).calls)*15;j++) { weightedpixel px=calls.countries.get(i).getpixel(); RPoint Sp=ptrans.form(pnorm.alise(px.randompt(5.0))); RPoint Ep=ptrans.form(pnorm.alise(Ireland.getpoint())); - //gstroke.drawstroke(Sp,Ep,fg); + gstroke.drawstroke(Sp,Ep,fg); //RPoint Dp=smap.per(Sp,4); //ellipse(Dp.x+hw,Dp.y+hh,2,2); - ellipse3d(Sp,(px.bright*.00001)+.000002,4); + + } + } + } + if (true) { //draw area call based circles + float ascale=0.005; + if (calls.countries.get(i).points.size()>0) { + float area=calls.countries.get(i).calls; + while (area>0) { + weightedpixel px=calls.countries.get(i).getpixel(); + RPoint Sp=ptrans.form(pnorm.alise(px.randompt(5.0))); + float b=min(px.bright,pow(area,0.5)/ascale); + ellipse3d(Sp,(b*.00002)+.000002,4); + area-=(pow(b,2)*ascale); } } } |
