# Transparent sphere

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

## Recommended Posts

Hi. I need to know how to draw a semi-transparent blue sphere. I also need to give a glow effect to lines to simulate lightning. I would appreciate any help on this. Thanks

##### Share on other sites
Hi

Make sure lighting is disabled, and enable blending with

glEnable (GL_BLEND);glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_DST_ALPHA); // I think it was like this, check http://msdn2.microsoft.com/en-us/library/ms537046.aspxglColor4f (0.0f, 0.0f, 1.0f, 0.5f); // blue with 50% opacity// draw your modelglDisable (GL_BLEND); // reset or something

The other thing is a bit more complicated.. exactly what do you mean?

//Johan

##### Share on other sites
Thanks for the help, the sphere is working.

glBlendFunc (GL_SRC_ALPHA, GL_ONE)
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_DST_ALPHA);

I'll now have to focus on getting the lighting right to make it look good. As it is now it seems a circle, not a sphere.

The idea is to simulate a plasma ball.
I have two spheres and I generate lines with a random path to simulate the sparks between them.
So I need to apply the glow around the lines to make it look more realistic.

##### Share on other sites
Typically for glow, you saved the image of an item to be "glowed" to a texture, blur that texture, and then draw it back over the screen. This will extend that objects color to neighboring pixels and make it appear to emit light.

##### Share on other sites
You could draw two spheres and the second one is larger than the first one by a small amount and blend it with a lighter transparency factor and a bit less blue???