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 3 of 3

Thread: unexpected results with GL_LINES

  1. #1
    Junior Member Newbie Tcll5850's Avatar
    Join Date
    Feb 2014
    Posts
    23

    unexpected results with GL_LINES

    yes, I'm using the FFP like a noob, but the interface I'm working on is scrap anyways...

    I'm having a little problem with this code:
    Code :
                        __GL.glLineWidth(3.5)
     
                        __GL.glBegin(GL_LINES)
                        __GL.glColor3f(1,1,1)
                        __GL.glVertex3f(CBL[0]*CBS[0],CBL[1]*CBS[1],CBL[2]*CBS[2])
                        __GL.glColor3f(0.5,0.5,0.5)
                        __GL.glVertex3f(CBL[0]*CBS[0],CBL[1]*CBS[1],CBL[2]*CBS[2])
                        __GL.glEnd()
     
                        __GL.glEnable(GL_LINE_STIPPLE)
                        __GL.glLineStipple(1, 0xAAAA) # [1]
                        __GL.glLineWidth(1.0)
     
                        __GL.glBegin(GL_LINES)
                        __GL.glColor3f(0,0,0)
                        __GL.glVertex3f(CBL[0]*CBS[0],CBL[1]*CBS[1],CBL[2]*CBS[2])
                        __GL.glVertex3f(PBL[0]*PBS[0],PBL[1]*PBS[1],PBL[2]*PBS[2])
                        __GL.glEnd()
     
                        __GL.glDisable(GL_LINE_STIPPLE)

    the code is used to show bone relations being:
    thick line white (bone head) to gray (bone tail)
    dotted thin black line showing parent/child relations

    the problem:
    everything draws thin and black

    how do I fix??

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,722
    Quote Originally Posted by Tcll5850 View Post
    Code :
                        GL.glBegin(GL_LINES)
                        GL.glColor3f(1,1,1)
                        GL.glVertex3f(CBL[0]*CBS[0],CBL[1]*CBS[1],CBL[2]*CBS[2])
                        GL.glColor3f(0.5,0.5,0.5)
                        GL.glVertex3f(CBL[0]*CBS[0],CBL[1]*CBS[1],CBL[2]*CBS[2])
                        GL.glEnd()
    Note that both vertices have identical positions, i.e. the line has zero length.

  3. #3
    Junior Member Newbie Tcll5850's Avatar
    Join Date
    Feb 2014
    Posts
    23
    ._.
    wow did I really just make that dumb of a mistake...

    ...
    I certainly did >3<
    sorry guys, carry on

Posting Permissions

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