Jump to content
  • Advertisement
Sign in to follow this  

Weird Line Problems

This topic is 4735 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!