issue rotating around an axis
in
Programming Questions
•
2 years ago
I can't figure out why this won't align my text from the center of the ellipse out at a 45 degree angle. I think its a problem with me setting up the axis at the center of the circle.
thanks,
- class Bubble {
- String search;
- float r = 100;
- float x,y;
- color c;
- float xdir = random(0,500);
- float ydir = random(0,500);
- Bubble(String search_, float r_, float x_, float y_)
- {
- search = search_;
- r = r_;
- x = x_;
- y = y_;
- if (search.length() > 2)
- c = color(search.charAt(0)*2,search.charAt(1)*2,search.charAt(2)*2,100);
- }
- void display() {
- stroke(255);
- fill(c);
- ellipse(xdir, ydir, r,r);
- //i think the issue is here
- pushMatrix();
- translate(xdir,ydir);
- rotate(-HALF_PI/2);
- fill(255);
- text(search,xdir,ydir);
- popMatrix();
- }
1