Hey guys if I want my text to be in the middle what can I change?

PFont myFont;

String s1= ("OBECALP PHARMACY ");
float angleSpeed= TWO_PI/s1.length();
float letterX,letterY;
int i,cntX,cntY;
int radius =260;

float z=random(TWO_PI);
float x=0;
float y;
float r =0;

float offset;
float ntext;

float t=100;

float angle,c,x1,y1=0;
float speed = 0;
int waveStrengthHorizontal= 5;
int waveStrengthVertical= 5;

float u,v;
void setup() {
  size(800, 800, P3D);
  background(255);
  myFont = createFont("DrukTextWide-Heavy.ttf", 20);
  //textFont(myFont);
frameRate(20);
}

void draw() {
background(255);


i=s1.length();
printQuote();
}

void printQuote(){
  
 
  
int count =0;
for(y=0; y<500; y++){
if(count%10==0)
  {
  
int  cntY =0, cntX =width/2;
for (int j = 0; j < i; j++) 

{
    letterX = cntX + radius * cos(j*angleSpeed);
    letterY = cntY + radius * sin(j*angleSpeed);
    
    
     
          
pushMatrix();

rotateY(r);
//rotateX(x1);

 translate(letterX, cntX, letterY);
 textSize(20);
 
 fill(0, 0, 0);
 text(s1.charAt(j),x,y);
 t++;

  popMatrix();
  
}
}
count++;
r=r+0.0001; angle+=10;
//speed=0.01;
  }
}

https://processing.org/reference/textAlign_.html

it’s not that i tried =/

i think it’s the r function

Now it stops spinning but it’s in the center haha now can i do to spinning =/

PFont myFont;

String s1= ("OBECALP PHARMACY ");
float angleSpeed= TWO_PI/s1.length();
float letterX,letterY;
int i,cntX,cntY;
int radius =260;

float z=random(TWO_PI);
float x=0;
float y;
float r =0;




float angle,c,x1,y1=0;
float speed = 0;
int waveStrengthHorizontal= 5;
int waveStrengthVertical= 5;

float u,v;
void setup() {
  size(800, 800, P3D);
  background(255);
  myFont = createFont("DrukTextWide-Heavy.ttf", 20);
  //textFont(myFont);
frameRate(20);
}

void draw() {
background(255);


i=s1.length();
printQuote();
}

void printQuote(){
  
 
  
int count =0;
for(y=0; y<500; y++){
if(count%10==0)
  {
  
int  cntY =0, cntX =width/2;
for (int j = 0; j < i; j++) 

{
    letterX = cntX + radius * cos(j*angleSpeed);
    letterY = cntY + radius * sin(j*angleSpeed);
    
    
     
          
pushMatrix();

//rotateY(r);
//rotateX(200);

 translate(letterX, cntY, letterY);
 textSize(20);
 
 fill(0, 0, 0);
 text(s1.charAt(j),x,y);
 

  popMatrix();
  
}
}
count++;
//r=r+0.0001; angle+=10;
//speed=0.01;
  }
}

Using cntY in this line is not wise since you use it in another spot with another purpose

Hence either use 0 or name a new variable like heightCircle

It depends on what you want to achieve and you don’t explain this.

Spinnig what around which axis?

You might want rotateY (r); before the 2nd for loop

continued other thread