Ellipse/circle clipping mask in 3d text output

hi, I’m working on a project where text is output in 3d renderer rotating around various axis and moving across. Below is the simplified version. It uses rectangular mask through clip(), but i can’t find a way to make it circular as if i look at the screen through a hole.

Anyone came across something like that before?
Thanks in advance!

void setup() {
  size(300, 300, P3D);                         
  fill(300, 300, 0);
  textAlign(LEFT, CENTER);
  background(0);
}  

float x = 12;
float y = 45;

void draw() { 
  background(0);
  textSize(56);
  fill(0, 102, 153, 500);
  
  pushMatrix();
     rotateY(radians(30));
     clip(10,10,200,100);
     text("word", x, y);
    x += 1;
  popMatrix();

   clip(0, 0, width, height);
}

Clip is very limited as you found out. I suggest you check the following posts. They could be used in 3D as well after some tweaking:

Kf

1 Like