PDA

View Full Version : Drawing line with patterns



Naveen_R
12-16-2008, 03:29 AM
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

Brolingstanz
12-16-2008, 09: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.

Naveen_R
12-16-2008, 08: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.

Thanks

Ilian Dinev
12-16-2008, 10:54 PM
http://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/
Shaders are programs for the gpu to run - they specify the color of pixels drawn.