GL_POINTS size????

Started by
5 comments, last by MENTAL 18 years, 9 months ago
Hello Thread reader, I programm for a while but i just started with OpenGL, and im making some kind of level editor using the GL_POINTS type. So my question is there a way i can change the size of a point drawn with the GL_POINTS type. I know there is some kind of extencion or something but i don't know where i can get some info about it. All you help is apricated. Tjaalie,
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
Advertisement
glPointSize(2.0);

The points will be square, unless you turn on glEnable(GL_POINT_SMOOTH), then they will be round and smooth and pretty.

Edit: Oh yeah, and turn on blending for the round dots, as Fruny notes. Something like this should do that:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
(Not sure if setting the blendfunc is even necessary.)
Quote:The points will be square, unless you turn on glEnable(GL_POINT_SMOOTH), then they will be round and smooth and pretty.


IIRC, you also need to enable alpha blending.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
I should also point out that this size is fixed, regardless of how far away the point is (so a point at 10km is the same size as one at 1m). If you want your points to get bigger and smaller like other objects then you will need to look at billboards instead.
thanks for your help (all of you),
it works now:D.

Tjaalie,
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
Quote:Original post by MENTAL
I should also point out that this size is fixed, regardless of how far away the point is (so a point at 10km is the same size as one at 1m). If you want your points to get bigger and smaller like other objects then you will need to look at billboards instead.
You wouldn't need to use billboards, you could just use glPointParameter to set up attenuation.
God damnit I wish I paid more attention to the GL specs.

/me goes off to rewrite his particle renderer.

This topic is closed to new replies.

Advertisement