transperancy
The following code is how I place a player onto the field, what if I wish to make them transperant of 50%? I have tried glColor4f(1.0f, 1.0f, 1.0f, 0.5f); but it isn't that simple.
class player_graphics
{
glLoadIdentity();
glTranslatef(x, y, z);
glColor3f(1.0f, 1.0f, 1.0f);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-bl, 0.0f, 0.15f);
glTexCoord2f(1.0f, 0.0f); glVertex3f(bl, 0.0f, 0.15f);
glTexCoord2f(1.0f, 1.0f); glVertex3f(bl, (bh*2), 0.15f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-bl, (bh*2), 0.15f);
glEnd();
}
Edited by - phantom007 on January 20, 2002 5:22:50 PM
www.koalacomics.com.au for a humour comic
www.lobag.com for my fantasy RPG PBBG
www.testcricketmanager.com for my sports management game
www.lobag.com for my fantasy RPG PBBG
www.testcricketmanager.com for my sports management game
you have to enable blending first I think:
In your initialization code, throw in these two lines:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Now when you do glColor4f(x, y, z, a) . . . the ''a'' will affect the color.
In your initialization code, throw in these two lines:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Now when you do glColor4f(x, y, z, a) . . . the ''a'' will affect the color.
"PC Load Letter, what the F*Ck's that" ~Office Space
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement