View Full Version : Drawing line with patterns
12-16-2008, 02:29 AM
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?
12-16-2008, 08:23 AM
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.
12-16-2008, 07:34 PM
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.
12-16-2008, 09:54 PM
Shaders are programs for the gpu to run - they specify the color of pixels drawn.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.