Results 1 to 3 of 3

Thread: how to change attributes of line in opengl

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2005
    Posts
    2

    how to change attributes of line in opengl

    hi,
    my problem at hand is that i have an entity say line and i want to change it's attributes such as thickness,line type(broken,normal line etc) ,(endstyle of line say round,rectangular etc)etc .Now all the data and attributes of line is in a smart array defined as such in the code.Now in opengl can we change all this GDI calls and apply it on the same line which draws the line using opengl.It would be really great if someone can help.Thanks in advance,
    regards,
    anshuman

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: how to change attributes of line in opengl

    On OpenGL there is
    - glLineWidth,
    - glLineStipple, and
    - glEnable(GL_LINE_SMOOTH) for antialised lines (needs blending to work nicely)

    OpenGL implementations vary in supporting different line widths. The basic requirement is min and max width == 1.0.
    You need to query the "range" and "granularity" (search the OpenGL spec) to find out what sizes are supported in aliased and antialised mode.

    Line cappings can not be changed. There are two modes, aliased lines are cut horizontally or vertically depending on the x- or y-major length.
    Antialised lines are drawn as rectangles with capping 90 degrees to the line direction. Some implementations don't even do that right.

  3. #3
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: how to change attributes of line in opengl

    Lines in OpenGL is a little more limited, you can use glLinewidth to set width of line (hardware may limit the width for you) and you can use glLineStipple to set bit patterns for lines, that is about it, you can also do some neat effects with blending of course.

    Mikael

Similar Threads

  1. Replies: 1
    Last Post: 08-30-2017, 08:54 PM
  2. draw line, line-size ... opengl 3.3 ?
    By CarstenT in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-28-2014, 08:19 AM
  3. change the line color frequently
    By FaceLess_ in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-06-2009, 06:16 PM
  4. Is it possible to change line width somehow besides glLineWidth()?
    By Jackis in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 06-01-2006, 02:26 AM
  5. Change line size
    By amstel in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-18-2002, 11:49 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