Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: 3D screen precision of OpenGL

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2012
    Posts
    8

    Lightbulb 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. #2
    Member Regular Contributor
    Join Date
    Aug 2008
    Posts
    455
    Are you using GL_LINES? Try using GL_LINE_STRIP.

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2012
    Posts
    8
    Quote Originally Posted by Dan Bartlett View Post
    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. #4
    Member Regular Contributor
    Join Date
    Jan 2005
    Location
    USA
    Posts
    411
    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.
    Last edited by michagl; 09-25-2012 at 07:39 PM.
    God have mercy on the soul that wanted hard decimal points and pure ctor conversion in GLSL.

  5. #5
    Member Regular Contributor
    Join Date
    Aug 2008
    Posts
    455
    Quote Originally Posted by alneam View Post
    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
  •