/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import processing.opengl.*; void setup() { size(1100, 1100, OPENGL); background(0,30,60); PFont font; font = loadFont("SansSerif-48.vlw"); textFont(font); fill(255); translate(width/2, height/2); textAlign(RIGHT); textSize(10); float r = 420; stroke(255, 30); for (int j=0; j<connections.length; j++) { int[] node = int(split(connections[j], ',')); line(r*cos(PI + 2*PI/friends.length*(node[0]+0.5)), r*sin(PI + 2*PI/friends.length*(node[0]+0.5)), r*cos(PI + 2*PI/friends.length*(node[1]+0.5)), r*sin(PI + 2*PI/friends.length*(node[1]+0.5)) ); } for (int i=0; i<friends.length; i++) { //println(friends[i]); text(friends[i], -r-2, 0); rotate(2*PI/friends.length); } } void draw() { //nothing yet }