PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

question about draw line with width

i know the Bresenham and DDA way to draw one line, but, how to draw line with given width? for example, I can use Bresenham way to draw one 1 pixel width line, how can i draw the line with 3 or 10 pixels width?

I saw one sample which used filled circle instead of draw one pixel, I tried this way but the performance is poor, any other way?

please give me one sample, thanks.
joshbu [MSFT] · 02 Oct 2006, 17:51 UTC
Are you using a 3D API like D3DM? You can draw two triangles as a nice wide line substitute.
That's basically it:

Draw the line as a quad (or two triangles). Then write a specialized rasterizer for it and take all optimization opportunities you can get (the quads you generate for a thick line have lots of values that you can share across edges).