How to get smooth points instead of square points in OpenGL

Started by
3 comments, last by Cornstalks 12 years ago
Hi everyone,


I am using GLUT in ubuntu 10.10, when i try to draw smooth points in OPENGL using below code i am not getting circular points, instead of that
i am getting square points


void draw_points()
{
GLfloat v1[2] = {0.25,0.25};
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.8, 0.5, 0.0);
glPointSize(5.0f); //setting the size of the points
glEnable( GL_POINT_SPRITE ); // GL_POINT_SPRITE_ARB if you're
glEnable( GL_POINT_SMOOTH ); // using the functionality as an extension.
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );

glBegin(GL_POINTS);
glVertex2fv(v1);
glVertex2f(0.75,0.25);
glVertex2f(0.85,0.50);
glVertex2f(0.75,0.75);
glVertex2f(0.25,0.75);
glVertex2f(0.15,0.50);
glEnd();
glFlush();

}


please tell me where i am going wrong

thanks a lot in advance,

GG
Advertisement
Google is your friend. I just googled [color=#000000][size=2]

GL_POINT_SMOOTH

and I found a whole bunch of results. Here's one that looks promising:

http://stackoverflow.com/questions/1513811/getting-smooth-big-points-in-opengl
scottrick49
I have already tried that, you can see that in my program itself, but it did not help me, if you got any other way please tell me
Try to enable FSAA but imo it would be easier to either map a texture or draw a small filled circle with 1x1 vertices.
Or you could ditch rendering in immediate mode and use shaders (which you should anyway)...
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

This topic is closed to new replies.

Advertisement