マウスの座標に応じて文字が球体の周りを回転するものです。
コードは下記。
球体の周りのテキストには、任意のRSSフィードを引っ張ってきて遊ぶのも良いかと思います。
PFont myFont;
int rad = 100;
int theta = 0;
void setup() {
size(600, 600, P3D);
myFont = loadFont("Georgia-48.vlw");
textFont(myFont, random(20,32));
}
void draw() {
String[] msg = new String[13];
for(int num = 0; num < msg.length; num++){
msg[num] = "message"+num;
}
background(225);
//stroke(255, 50);
noStroke();
lights();
translate(300, 300, 0);
rotateX(mouseY * 0.05);
rotateY(mouseX * 0.05);
fill(230, 230, 230);
//sphereDetail(mouseX / 4);
sphere(100);
for(int i=0; i< msg.length;i++){
theta = 30*i;
rotateX(PI/3.0);
if(i%3==0){
//text(msg[i],100+10*i,100+10*i,100+10*i);
fill(0, 102, 153,100);
text(msg[i],rad*cos(theta),rad*sin(theta),100+10*i);
}else if(i%3==1){
fill(102,102,255,100);
text(msg[i],rad*cos(theta),-rad*sin(theta),100+10*i);
}else{
fill(153,0,51,100);
text(msg[i],rad*cos(theta),rad*sin(theta),100+10*i);
}
}
}