Results 1 to 5 of 5

Thread: Can't draw points

  1. #1
    Member Newbie
    Join Date
    Sep 2009
    Location
    Corroios, Portugal
    Posts
    48

    Can't draw points

    I'm trying to draw point over a textured polygon, but the points are not seen on screen, although everything else is. Is there any reason for this to happen?


    Dim intCounter As Integer

    Gl.glClear(Gl.GL_COLOR_BUFFER_BIT Or Gl.GL_DEPTH_BUFFER_BIT)



    Gl.glPushMatrix()




    Gl.glBindTexture(Gl.GL_TEXTURE_2D, texture)
    Gl.glBegin(Gl.GL_TRIANGLE_STRIP)
    Gl.glColor3f(1.0F, 1.0F, 1.0F)

    Gl.glTexCoord2f(-1.0, 0.0) : Gl.glVertex3f(0.0, m_size.Height, 0.0)
    Gl.glTexCoord2f(-1.0, 1.0) : Gl.glVertex3f(0.0, 0.0, 0.0)
    Gl.glTexCoord2f(0.0, 0.0) : Gl.glVertex3f(m_size.Width, m_size.Height, 0.0)
    Gl.glTexCoord2f(0.0, 1.0) : Gl.glVertex3f(m_size.Width, 0.0, 0.0)
    Gl.glEnd()

    If m_curPoints > 0 Then
    Gl.glPointSize(45)
    Gl.glColor3f(1.0F, 0.0F, 0.0F)
    For intCounter = 0 To m_curPoints - 1
    Gl.glBegin(Gl.GL_POINT)
    Gl.glVertex3f(m_Points(intCounter).X, m_Points(intCounter).Y, 0.0)
    Gl.glEnd()
    Next
    End If

    Gl.glPopMatrix()
    Gl.glFlush()

  2. #2
    Member Contributor
    Join Date
    Jan 2007
    Posts
    89

    Re: Can't draw points

    Are they visible when you alter their z-value slightly(try 0.01f or -0.01f)?
    Disable the texturing for debugging.

  3. #3
    Member Newbie
    Join Date
    Sep 2009
    Location
    Corroios, Portugal
    Posts
    48

    Re: Can't draw points

    Thank you for your reply.
    I've tryed your suggestions but didn't work. No points are drawn

  4. #4
    Senior Member Regular Contributor
    Join Date
    Dec 2008
    Location
    USA
    Posts
    134

    Re: Can't draw points

    The constant you want for glBegin is GL_POINTS, with the 'S', not GL_POINT. GL_POINT gets used for the polygon mode, not a primitive type.

  5. #5
    Member Newbie
    Join Date
    Sep 2009
    Location
    Corroios, Portugal
    Posts
    48

    Re: Can't draw points

    You are absolutly right. Thanks

Similar Threads

  1. How can draw line to different points?
    By pelaoqlo in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 02-05-2019, 08:32 AM
  2. How to draw points efficiently
    By orsonl in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-21-2017, 09:40 PM
  3. How to draw a curve and points together?
    By sam_thedancer in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 07-23-2013, 09:27 AM
  4. Draw crosses instead of points
    By paule in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 08-04-2010, 09:23 AM
  5. How can I draw an arrow between 2 points?
    By torbjorn in forum OpenGL: General
    Replies: 2
    Last Post: 07-07-2004, 12:53 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