Thread: 3D screen precision of OpenGL

1. 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

2. Are you using GL_LINES? Try using GL_LINE_STRIP.

3. Originally Posted by Dan Bartlett
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___________________________________

4. 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.

5. Originally Posted by alneam
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___________________________________
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.

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•