Is there a way to make a rotation just for one small string of glutBitmapCharacter? At the moment my rotation does nothing until I minimise and maximise the window at which point everything in the window rotates around the origin but the small image itself wont rotate around it's centre!
I think I'm having problems with the Pop/PushMatrix commands or I just don't know where to call glRotatef.
Code:
void b(float x, float y, char *string, void *font)
{
glRasterPos2f(x, y);
int len, i;
len = (int) strlen(string);
for (i = 0; i < len; i++)
{
glutBitmapCharacter(font, string[i]);
}
glRotatef(45,0.0,0.0,1.0);
glPopMatrix();
}
void display(void)
{
glClear(GL_COLOR_BUFFER_BIT) ;
outline() ;
a(-0.25,0.5,"RD", GLUT_BITMAP_TIMES_ROMAN_24) ;
b(0.25,0.5,"RD", GLUT_BITMAP_TIMES_ROMAN_24) ;
glutSwapBuffers() ;
}
These are the two parts of code in question, basically the idea is to have the b function to rotate 45 degrees anti-clockwise when I run the program.
Thanks for reading.
Bookmarks