summaryrefslogtreecommitdiff
path: root/vodaviz.pde
diff options
context:
space:
mode:
Diffstat (limited to 'vodaviz.pde')
-rw-r--r--vodaviz.pde48
1 files changed, 27 insertions, 21 deletions
diff --git a/vodaviz.pde b/vodaviz.pde
index 4ca3dbc..89d82d1 100644
--- a/vodaviz.pde
+++ b/vodaviz.pde
@@ -203,7 +203,7 @@ calldata calls;
bitmapcountry Ireland;
bezierstroke bstroke;
-gradientstroke3D gstroke;
+linear3D gstroke;
float hw,hh;
@@ -211,11 +211,11 @@ PImage lightmap;
color bg,fg;
void setup(){
- println("vodaviz v0.21");
+ println("vodaviz v0.6");
RG.init(this);
mode="PDF";
- if (mode=="PDF") size(832,220,PDF, "vodaviz_circles_200212.pdf"); //P3D); //832,220); //nb pdf is 800x600
+ if (mode=="PDF") size(832,220,PDF, "vodaviz_lines_220212.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
@@ -228,7 +228,7 @@ void setup(){
smooth();
float m = millis();
- shp = RG.loadShape("countries_named_mercator.svg"); //test_drawing.svg"); //world_countries_outlines_split.svg");
+ shp = RG.loadShape("countries_named_mercator_fixup.svg"); //test_drawing.svg"); //world_countries_outlines_split.svg");
pnorm = new pointNormalise(18.279,746.302,109,374.293);
ptrans = new pointTransform();
@@ -244,12 +244,12 @@ void setup(){
float bezierfract=0.25;
bstroke = new bezierstroke(startsize,endsize,linewidth,mpfract,raisefract,bezierfract);
- startsize=2;
- endsize=.2;
+ startsize=.2;
+ endsize=.02;
float[] transpos={0.0,0.25,0.75,1.0};
- float[] transamt={0.5,0.05,0.05,0.5};
+ float[] transamt={1.0,1.0,1.0,1.0}; //{0.5,0.05,0.05,0.5};
color col=color(0,0,0);
- gstroke=new gradientstroke3D(startsize,endsize,transpos,transamt,col,smap);
+ gstroke=new linear3D(startsize,col,smap);
RG.ignoreStyles();
println("loaded svg in "+((millis()-m)*.001)+" seconds");
@@ -312,11 +312,14 @@ void draw() {
//
//pick a random colour
- colorMode(HSB);
- fg=color(random(255),255,150,50);
+ //colorMode(HSB);
+ //fg=color(random(255),255,150,255);
+ //fill(fg);
+ //noStroke();
//stroke(fg);
- noStroke();
- fill(fg);
+ //noFill();
+
+ //stroke((int)random(255),255,150);
//stroke(0,0,0,50);
@@ -365,29 +368,32 @@ void draw() {
//println("plotting "+calls.countries.get(i).name+": "+calls.countries.get(i).calls+" calls");
}
- if (false) { //draw gradient 3D lines
+ if (true) { //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);
- //RPoint Dp=smap.per(Sp,4);
- //ellipse(Dp.x+hw,Dp.y+hh,2,2);
}
}
}
- if (true) { //draw area call based circles
- float ascale=0.005;
+ if (false) { //draw area call based circles
+ println("drawing "+calls.countries.get(i).name+", calls "+calls.countries.get(i).calls);
+ float ascale=0.001;
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);
+ //float b=min(px.bright,pow(area,0.5)/ascale);
+ float b=200;
+ area-=(pow(b,2)*ascale)+1;
+
+ //ellipse3d(Sp,(b*.00002)+.000002,4);
+ RPoint Dp=smap.per(Sp,4);
+ ellipse(Dp.x+hw,Dp.y+hh,(b*.02)+.1,(b*.02)+.1);
}
}
}
@@ -405,7 +411,7 @@ void draw() {
endShape();
//println("drawing "+calls.getcountry(i).name+": "+calls.getcountry(i).outline.paths[0].commands.length+" points");
}
- if (true) { //draw lines
+ if (false) { //draw lines
for (int j=0;j<log10(calls.countries.get(i).calls)*1;j++) {
RPoint s=calls.countries.get(i).getpoint();
RPoint e=Ireland.getpoint();