PDA

View Full Version : sphere



satya
05-19-2006, 08:04 AM
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 *)&amp;points[i]);

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

TIA
Satya

mikael_aronsson
05-19-2006, 12:23 PM
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();