Skip to main content
GameDev.net gamedev.net
🔒 Locked

GL_POINTS size????

Started by Tjaalie Jul 19, 2005 at 9:26 AM 5 replies 25.1k views
Original Post
Tjaalie
Tjaalie
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; };
marijnh
marijnh
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.)
Fruny
Fruny
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
MENTAL
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.
Tjaalie
Tjaalie
thanks for your help (all of you),
it works now:D.

Tjaalie,
if (*pYou == ASSHOLE) { pYou->Die(); delete pYou; };
Myopic Rhino
Myopic Rhino
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.
MENTAL
MENTAL
God damnit I wish I paid more attention to the GL specs.

/me goes off to rewrite his particle renderer.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.