Results 1 to 4 of 4

Thread: Drawing line with patterns

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2008
    Posts
    3

    Drawing line with patterns

    Hi all,

    I want to draw a line with patter "----- -- "( 1111100011000 ). The problem is that, the glLineStipple() function accepts pattern in short variable(16 bits). But in my case there is only 13 bits.

    Is there any method to draw a line with the above pattern?

    Thanks
    Naveen

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Sep 2004
    Location
    Prombaatu
    Posts
    1,386

    Re: Drawing line with patterns

    FYI, line/polygon stipple is deprecated...

    You can do a lot of cool things with textures and shaders. For polygon stipple, generate texture coords in window space with any pattern you like. With lines, same deal only you'd need to take direction into account. Haven't played with a line stipple replacement yet, but the polygon replacement looks good and is far more flexible.

    Hope it helps.

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2008
    Posts
    3

    Re: Drawing line with patterns

    Thanks for the information. I will try your suggestion. How ever since I am just a beginer, I didnt fully understand your comment. It will be greatly helpful if you provide me some sample code or link to some sample code.

    Thanks

  4. #4
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,294

    Re: Drawing line with patterns

    http://www.opengl.org/sdk/docs/tutor...ockworkCoders/
    Shaders are programs for the gpu to run - they specify the color of pixels drawn.

Similar Threads

  1. Drawing points before drawing a curve line
    By PepeBeef in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-26-2017, 09:34 PM
  2. Drawing 3D line
    By opendj in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 02-06-2011, 10:22 AM
  3. Drawing a full line over a stippled line
    By schtroumpfbleu in forum OpenGL: Basic Coding
    Replies: 11
    Last Post: 11-04-2010, 02:13 PM
  4. Need help with drawing a line
    By brett01 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-18-2010, 10:02 PM
  5. Line drawing.
    By imported_newbie in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-14-2000, 11:57 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