Hi,
I'm trying to render text in my glwidget:
text = "TEST test";
float x, y, z;
x = 0;
y = 0;
z = 0;
float red, green, blue;
red = 1;
green = 0;
blue = 1;
font.setFamily("algerian");
font.setPointSize(25);
glPushMatrix();
glColor3f(red, green, blue);
renderText(x, y, z, text, font);
glPopMatrix();
QString text;
text = "TEST test";
float x, y, z;
x = 0;
y = 0;
z = 0;
float red, green, blue;
red = 1;
green = 0;
blue = 1;
QFont font;
font.setFamily("algerian");
font.setPointSize(25);
glPushMatrix();
glColor3f(red, green, blue);
renderText(x, y, z, text, font);
glPopMatrix();
To copy to clipboard, switch view to plain text mode
All my experimenting is resulting in clipping of the text:
1.) If I increase setPointSize beyond a certain point, clipping starts to happen.
2.) If I change x y z coordinates, clipping happens (this one appears to change the size of the viewport for the text box)
3.) If I setPointSize to around 15, I get what I'm going to call natural clipping i.e. half of "TEST test" is clipped i.e. you can only see "TEST".
So it looks like there's like two viewing ports, one for whatever I want to display in paintGL() and one that gets created and pasted on top of the background viewport that contains the text (I'm going to call this 'display box').
Two questions:
1.) How do manipulate the 'display box' that contains the text so that I can resize it to any size I want and have it not get clipped?
2.) How do I move the text around in my window because X Y Z seems to change the dimensions of the 'display box' not actually move the text around in my gl viewing box?
Bookmarks