Thx a lot JohnG !!!
You really answer so fast on this board, that's really helpfull.
Having this working i have another question. I want to bend a string along the little circle, the first letter of the string coordinates start at the red point and should be align aside the light grey line.
Here's the example:
Quote:
String s = "Test"; //try different string length
float slength = s.length();
float radius;
PFont font;
void setup() {
size(200, 200);
background(255);
smooth();
//trace the grid system
line(width/2, 0, width/2, height);
line(0, height/2, width, height/2);
stroke(0,80);
line(0, 0, width/2, height/2);
//trace the circles
radius = constrain((slength*20), 0, width);
println(radius);
println(radius/3);
noStroke();
fill(radius, 0, 0, radius);
ellipse(width/2, height/2, radius, radius);
fill(radius, 0, 0, radius/2);
ellipse(width/2, height/2, radius/3, radius/3);
//trace the point
stroke(255, 0, 0);
strokeWeight(5);
//point((width/2)+radius/6*cos(3*PI/4.0), (height/2)+radius/6*sin(-3*PI/4.0));
point((width/2) + radius/6*cos(5*PI/4.0), (height/2) + radius/6*sin(5*PI/4.0));
font = createFont("Bookman Old Style", 48, true);
textFont(font, 24);
fill(0);
}
void draw() {
translate((width/2)+radius/6*cos(5*PI/4.0), (height/2)+radius/6*sin(5*PI/4.0));
for (int i=0; i < s.length(); i++) {
//rotate(radius/6); <<<<<<<< What's the rotation formulas there ??
text(s.charAt(i), 0, 0);
translate(textWidth(s.charAt(i)), 0);
}
}
Thx.