Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: glLineWidth - doesn't work !

  1. #1
    Guest

    glLineWidth - doesn't work !

    Help! I've been trying to sort out this problem for ages, and I am _not_ getting anywhere!

    It seems that
    glLineWidth(5.0f);
    does not have any effect on lines, and they remain just one pixel thick (even if I try a whole range of numbers).

    glPointSize(5.0f) works perfectly, and enabling GL_LINE_SMOOTH doesn't seem to make any difference other than slightly thicker lines.

    Can anyone help?

  2. #2
    Intern Newbie
    Join Date
    Oct 2001
    Posts
    38

    Re: glLineWidth - doesn't work !

    Works for me onserveral Unix and Windows platforms.

    Perhaps if you post a little more info such as OS,graphics, a little code we may be able to help more

  3. #3
    Intern Contributor
    Join Date
    Jun 2001
    Posts
    69

    Re: glLineWidth - doesn't work !

    the only width which is guaranteed is 1.0
    support for other is implemantation depedent

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    3,115

    Re: glLineWidth - doesn't work !

    Maybe your implementation does not support thick lines. Try the following piece of code to see how thick lines you can use.
    Code :
    float lineWidth[2];
    glGetFloatv(GL_LINE_WIDTH_RANGE, lineWidth);
    lineWidth[0] is the minimum width, and lineWidth[1] is the maximum.

  5. #5
    Guest

    Re: glLineWidth - doesn't work !

    I'm using opengl on a mac, with a voodoo 2 card. The actual procedures are like so:


    GLvoid DrawBuilding(int by, int bx)
    {
    glPushMatrix();
    glTranslatef(bx * griddist,by * griddist,0.0f);
    glEnable(GL_LINE_SMOOTH);
    glLineWidth(160000/(px*px));
    {where px is your distance away, a value ranging from anything up to a distance of 600}

    glBegin(GL_LINES);
    glVertex3f( 0.0f, 0.0f, 0.0f);
    glVertex3f( 0.0f, 0.0f, 500.0f);
    glEnd();
    glPopMatrix();
    }

    This is then used to draw a large grid of vertical lines, disappearing into the distance. It works perfectly, except the line widths do not change. Replacing GL_LINES with GL_POINTS and glLineWidth with glPointSize gives a series of points which get bigger when you get closer, and I was hoping to do this also with lines.

  6. #6
    Member Regular Contributor
    Join Date
    Jun 2000
    Location
    Karlsruhe, Germany
    Posts
    486

    Re: glLineWidth - doesn't work !

    You'll get errors and even more errors with V2, 3dfx drivers suck.

    -Lev

  7. #7
    Guest

    Re: glLineWidth - doesn't work !

    How do I change the minimum and maximum linewidths? I tried out the previous procedure and recieved 0.0 for min and 10.0 for max... is it a fault with the driver? (I know that on some ati drivers, points come out as squares even with GL_POINT_SMOOTH enabled, is this a similar case?) I appreciate your comments

  8. #8
    Guest

    Re: glLineWidth - doesn't work !

    Even staying within the range of 0.0 and 10.0, I'm getting just single thickness lines (using glLineWidth(8.0f) for example). There aren't any other variables to enable beforehand ?

  9. #9
    Intern Contributor
    Join Date
    Oct 2001
    Location
    Germany
    Posts
    75

    Re: glLineWidth - doesn't work !

    "How do I change the minimum and maximum linewidths?"

    You can't change this values the Proc
    glGetFloatv(GL_LINE_WIDTH_RANGE, lineWidth);
    say you what your OpenGL implementatin suport.

    O I have forgotten, there is a way to change the values by a other Graphic Card *g*

  10. #10
    Guest

    Re: glLineWidth - doesn't work !

    Sorry , I suppose I meant it the other way round (getting the values first and then asking the question) .

Posting Permissions

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