From 4deda1a179b3b644173fba67be00fc55063cc9d7 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Mon, 20 Feb 2012 01:59:03 +0000 Subject: area call circles --- vodaviz.pde | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'vodaviz.pde') 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;j0) { + 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); } } } -- cgit v1.2.3