Results 1 to 4 of 4

Thread: GL_LINES on different positions

  1. #1
    Junior Member Newbie
    Join Date
    May 2008
    Posts
    15

    GL_LINES on different positions

    In my OpenGL program I draw lines using glBegin(GL_LINES)

    I have tested this program on two different computers. All lines are drawn one pixel below on the first computer compared to the second computer. Why are the lines not drawn in the same position on both computers? Is it possible to make sure that the lines are drawn at the same position on both computers?


  2. #2
    Senior Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    Posts
    891

    Re: GL_LINES on different positions

    Read the section of the specification about line rasterization.

    Then draw your lines on pixel centers, instead of pixel corners.

  3. #3
    Junior Member Newbie
    Join Date
    May 2008
    Posts
    15

    Re: GL_LINES on different positions

    Thanks a lot for your reply! I really appreciate it.

    Quote Originally Posted by arekkusu
    Then draw your lines on pixel centers, instead of pixel corners.
    Do you by this mean that I should use coordinate values like 100.5, 102.5, 110.5 instead of 100, 102, 110?

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jun 2009
    Location
    FL , USA
    Posts
    192

    Re: GL_LINES on different positions

    Yes.

Similar Threads

  1. understanding GL_LINES
    By DanUK in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-21-2011, 10:48 AM
  2. Illuminating gl_lines
    By Dylan in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 12-17-2006, 02:03 AM
  3. GL_LINES
    By Luca in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 10-06-2002, 09:18 AM
  4. GL_LINES
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-30-2001, 07:01 AM
  5. GL_LINES Crashes my app.
    By wiggo in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 01-06-2001, 08:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean