Sign in to follow this  
neonoblivion

Weird Line Problems

Recommended Posts

neonoblivion    100
why would this code not render a line blending from semitransperent red to solid green? glLoadIdentity(); glLineWidth(5); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE); glBegin(GL_LINES); glColor4f(1,0,0,.5); glVertex3f(-.5,.38,-1); glColor4f(0,1,0,1); glVertex3f((charhealth/charhealthmax)*20,0,0); glEnd(); glDisable(GL_BLEND);

Share this post


Link to post
Share on other sites
neonoblivion    100
It's the start of a health bar, the load identity is because its drawn after the scene. linesmooth is enabled, and the lines I have draw emediatly before work, leading me to think it has somthing to do with the load identity...

Share this post


Link to post
Share on other sites
neonoblivion    100
I reallized that I didn't say exactly what it is doing :b its just drawing the line in the color that is defined first, rather than blending between the two.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this