Results 1 to 3 of 3

Thread: Inability to draw on certain pixels

  1. #1
    Guest

    Inability to draw on certain pixels

    Hi, I am using opengl to draw to a bitmap using VC++ in a CWND. I have set my view using orthogonal projection w/ parameters set to the size of the bitmap. I have noticed some inconsistancies when plotting lines similar to that of an audio signal. I have tested the plotting by drawing a vertical line from the bottom of the window to the top of the window for every pixel on the screen. The problem I have is that at about 3 quarters of the width of the screen whether I am using single or dual monitors, there are several vertical lines that don't get plotted. Blank lines range from 3 to over 12 and don't seem to be in any pattern. They are not continuous either. I am extremely stumped on why the drawing has been flawless except in this one small region with a width of about 30 pixels. I Any advice on this is appreciated

  2. #2
    Junior Member Newbie
    Join Date
    Jan 2001
    Location
    California
    Posts
    22

    Re: Inability to draw on certain pixels

    I had the same problem in orthogonal projection. But the problem only showed up on a Voodoo 3 graphics card, several different Geforce cards all rendered graphics acurately. I never found a solution or explanation. Since then I've been working with a normal projection matrix and haven't noticed any discrepencies.

    It is possible that I'm just not seeing it though, a triangle can be rendered across one of these gaps but a vertice cannot appear on these random lines.

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2003
    Location
    Ashford, Middlesex, UK
    Posts
    9

    Re: Inability to draw on certain pixels

    You could have some rounding artifacts going on. If you're drawing pixel-perfect lines, make sure you're not drawing with integer values, but with floats set to the *middle* of each pixel. Remember that in OpenGL, integer values are *between* pixels.

    Instead of glVertex2i(x, y) try glVertex2f(x + 0.5f, y + 0.5f).

    Aside from that, no idea. Can you post an obligatory screenshot, just in case it jogs someone's memory?
    Hellomynameis Charlie Dobbie
    Formerly "Charlie (Guest)"

Similar Threads

  1. Draw pixels to frame buffer
    By Itun.itu in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 01-04-2012, 10:38 AM
  2. How to draw pixels in OpenGL ES 2.0
    By JasonBecker in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-23-2010, 09:09 AM
  3. Fragment programs and gl{Draw,Copy}Pixels
    By kevin.watkins in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 12-01-2005, 12:20 PM
  4. The fastest way to draw pixels using OpenGL?
    By joda in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 11-13-2002, 10:36 AM
  5. Read/Draw Pixels Alternative
    By DaveTheBrv in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 11-17-2000, 12:26 PM

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