Greetings, I am using a function to render a health bar using quads. However I need to keep the quads on screen, right now it just floats in 3D space. Here is my current code:
Code:
void renderHealth(void)
{
glColor3f(1.0f, 0.0f, 0.0f);
glBegin(GL_QUADS);
glVertex3f(0.0f, 0.0f, 0.0);
glVertex3f((float)getHealth() / 100, 0.0, 0.0);
glVertex3f((float)getHealth() / 100, 0.3, 0.0);
glVertex3f(0.0f, 0.3f, 0.0f);
glEnd();
}
Right now I'm using the GluLookAt function but when I make any move the healthbar stays in place. Can someone make a suggestion on how to fix this?
If you know of a good 2D graphics library that works with OpenGlut please let me know.