Skip to content

Instantly share code, notes, and snippets.

@skihero
Created March 7, 2011 09:32
Show Gist options
  • Save skihero/858285 to your computer and use it in GitHub Desktop.
Save skihero/858285 to your computer and use it in GitHub Desktop.
lame attempt to write a svn log visualizer using processing
class Person {
int commits ;
String name ;
Person() {
this(0, "noname") ;
}
Person(int commits, String name) {
this.commits = commits ;
this.name = name ;
}
}
int personcount = 4;
Person [] ps = new Person [personcount] ;
String[] names = { "kingkong", "yaripon", "jackBauer", "epps" };
void setup() {
size(1024, 768, P3D) ;
noStroke();
for(int i = 0 ; i < personcount ; i ++ ) {
ps[i] = new Person(int(random(100)) , names[int(random(names.length))] ) ;
}
}
void mousePressed() {
redraw();
loop();
}
void mouseReleased() {
noLoop();
}
void draw() {
background(0);
lights();
int x = 40;
int y = 40;
int [] fills = new int [personcount] ;
fills[0] = 0 ;
fills[1] = 51 ;
fills[2] = 204 ;
fills[3] = 255 ;
for(int i = 0 ; i < personcount ; i ++ ) {
fill(fills[i]) ;
//ellipse(x, y, ps[i].commits , ps[i].commits ) ;
translate(x,y, ps[i].commits );
sphere(ps[i].commits ) ;
x+= 20 + ps[i].commits;
y+= 30 + ps[i].commits ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment