Text output in 3d using various rotations: text letters bounding box becomes not transparent

hi, i’m trying to output text in 3d using various rotations and subsequent text’s bounding box starts hiding the text below.

image

This is my code, very simple. Is there a way to fix this?

Thanks in advance!

void setup() {
  size(300, 300, P3D);                         
  fill(300, 300, 0);
  textAlign(LEFT, CENTER);
  background(0);
}  
void draw() { 
  background(0);
  textSize(56);
  fill(0, 102, 153, 500);
  
  pushMatrix();
     rotateY(radians(30));
     text("word", 12, 45); 
  popMatrix();
  
  pushMatrix();
     rotateY(radians(50));
     text("word", 12, 60);
  popMatrix();
}


2 Likes

play with
https://processing.org/reference/hint_.html

void setup() {
  size(300, 300, P3D);                         
  textAlign(LEFT, CENTER);
  //hint(ENABLE_DEPTH_TEST);
  //hint(ENABLE_DEPTH_SORT);
  hint(DISABLE_DEPTH_TEST);
  
}

void draw() { 
  background(200,200,0);

  textSize(56);
  fill(0, 102, 153, 500);
  pushMatrix();
  rotateY(radians(30));
  text("word1", 12, 45); 
  popMatrix();

  pushMatrix();
  rotateY(radians(50));
  text("word2", 12, 60);
  popMatrix();
}

2 Likes

thanks a lot! hint(DISABLE_DEPTH_TEST) fixed it

2 Likes