[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
Solved

# glutStrokeCharacter ->Scaling (OpenGL)

Posted on 2004-04-28
Medium Priority
2,869 Views
How do I scale a glutStrokeCharacter? I'm at a depth of about -20F....and if possible, how can I rotate the text 45 degrees?
0
Question by:rossryan
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
1 Comment

LVL 2

Accepted Solution

enkimute earned 2000 total points
ID: 10970660
you can use glTranslatef, glScalef and glRotatef to move, size or rotate the text.
You can even simply turn on antialiasing by using smooth lines and blending.

Haven't tested it, but all together should look something like :

x and y are offsets to the current raster position.
scale should be 1 for normal scale, higher for bigger letters, lower for smaller letters.
orientation is the nr of degrees rotated around the z axis. (0 aligns the text with the x axis)
Antialias is the strength of the letters. use 0.0 for no antialiasing.
*text points to a zero terminated string.

void output(GLfloat x, GLfloat y, GLfloat scale, GLfloat orientation, GLfloat antialias, char *text)
{
char *p;

glPushMatrix();
glTranslatef(x, y, 0);
glRotatef(orientation,0,0,1);
glScalef(scale,scale,scale);

if (antialias != 0)
{
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
glLineWidth(antialias);   // 2.0 gives good results.
}

for (p = text; *p; p++)
glutStrokeCharacter(GLUT_STROKE_ROMAN, *p);

if (antialias != 0)
{
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
}

glPopMatrix();
}
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
###### Suggested Courses
Course of the Month13 days, 17 hours left to enroll