We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I'm want to create a large 3D sketch, and keep track of the frameRate. The problem is that sometimes the 3D shapes overlap the frameRate text. I would like to display the frameRame always over the other shapes and objects, but I can find the best way to do it.
here is one example of a code with the text being overlapped:
PShape box;
float ry;
public void setup() {
size(640, 360, P3D);
box = createShape(BOX,200,400,5);
}
public void draw() {
pushStyle();
pushMatrix();
background(0);
lights();
translate(width/8, 200 , 0);
rotateZ(PI);
rotateY(ry);
shape(box);
ry += 0.015;
popStyle();
popMatrix();
fill(0,102,153);
textAlign(LEFT, BASELINE);
text(frameRate,50,30);
}
What is the best way to solve it?
Thanks
Answers
you can use this HUD-func