3D screen precision of OpenGL

hello everybody…
when i need to draw line by one of line algorithms using glvertix3f , it seemed to be as number of points in a Straight line , but my problem is that there is many of free pixels appeared between each two adjacent point , So how can I exceed this problem and make each two adjacent points be Convergent , also the Straight line appear smooth ??

the problem that drawing line appear as folow::

But i need it smooth as follow:


thanks in advance

Are you using GL_LINES? Try using GL_LINE_STRIP.

thanks for reply

Non of them … I need to apply the bresenham algorithm that calculate the pixels and draw it using glvertex3f command …

The idea that in 3D there is many of free pixels appear between any two adjacent points , how can i process it ??

for acknowledge while using the same algorithm in C++ the line appear smooth___________________________________

You might want to post an image if you can. In general consumer cards are not up to nice looking line drawing nowadays. You need a workstation card (more expensive) to do that, or you can draw chunky lines made out of triangles. There may be other techniques depending on what needs to be done.

EDITED: BTW you are not doing glBegin(GL_LINE…) ? That would be a problem if so.

[QUOTE=alneam;1242793]thanks for reply

Non of them … I need to apply the bresenham algorithm that calculate the pixels and draw it using glvertex3f command …

The idea that in 3D there is many of free pixels appear between any two adjacent points , how can i process it ??

for acknowledge while using the same algorithm in C++ the line appear smooth___________________________________[/QUOTE]

So you’re drawing the line using GL_POINTS? Why are you doing this? For educational purposes?

Does your algorithm handle the bresenham algorithm correctly in all 8 octants? If your algorithm doesn’t handle all octants correctly it’s possible to get gaps between the points generated.
If you’re drawing points with size > 1.0 + anti-aliasing is on, then perhaps that could cause problems too when drawing points that overlap.