sphere

Hi,

I need to display a small sphere to represent some points. I use the following code

    
glPointSize(size);
glBegin(GL_POINTS);
    
for(i=0; i<n_points; i++)
    glVertex3dv((const GLdouble *)&points[i]);

glEnd();

I display a box. Can you please suggest a way for me to display a sphere instead of box

TIA
Satya

Use a glu sphere or you can get round GL_POINTS, make sure that you have:

  • blending enabled.
  • blend function like SRC_ALPHA,ONE_MINUS_SRC_ALPHA for example.
  • Make sure the points are valid size (GL_POINT_SIZE_RANGE).

Please read documentation for glEnable( GL_POINT_SMOOTH); and glPointSize();