hi there!
in my little game I have some Objects obviously.
they all look very similar so I want to implement a method to label them with their name. so i did this:
Code:
void MyObject::printName()
{
const char *string = "test";
glPushMatrix();
glLoadIdentity();
double i;
glLineWidth(0.1);
glBegin(GL_LINE_STRIP);
for(i=0;i<2*PI;i+=PI/16)
glVertex3d(*fXPos+(radius+0.1)*sin(i),*fYPos+(radius+0.1)*-cos(i),0.0);
glVertex3d(*fXPos+(radius+0.1)*sin(0),*fYPos+(radius+0.1)*-cos(0),0.0);
glEnd();
glBegin(GL_LINE_STRIP);
glVertex3d(*fXPos+(radius+0.1)*sin(12*PI/16),*fYPos+(radius+0.1)*-cos(12*PI/16),0.0);
glVertex3d(*fXPos+(radius+0.2),*fYPos+(radius+0.2),0.0);
glEnd();
glRasterPos3f(*fXPos+radius+0.2,*fYPos+radius+0.2,0.0);
glColor3f(1.0,1.0,1.0);
while(*string) glutBitmapCharacter(GLUT_BITMAP_HELVETICA_10, *string++);
glPopMatrix();
}
this worked pretty well until I added a lightsource.
now the letters have the same color and shading of the object they are attached to. how can i prevent that???
thx+regards
/christian