PDA

View Full Version : How can I draw lines with rounded cap??



maccoo
05-08-2005, 06:14 PM
Recently, I am working on an opengl based project. There are so many lines to draw in 2D mode. I wanna draw these lines with rounded line cap using OpenGL, is it possible? if it is yes, how can I do that? any answer or reference will be appreciated.

dorbie
05-08-2005, 07:10 PM
OpenGL support for line drawing fairly basic. It does not explicitly support any kind of capping. To do this you'd have to implement your own either with polygons or textured polygons.

Lines of width 1 look OK and require no capping, lines of width greater than 1 are usually implemented by expanding vertically or horizontally depending on slope. This can leave gaps where a series of line segments cross this 45 degree boundary. This is also implementation dependent so YMMV. Implementations are free to implement high quality line capping, most don't.

maccoo
05-08-2005, 09:47 PM
thank you dorbie, another question is how to draw round join between two lines in opengl, in this aticle http://www.opengl.org/resources/tutorials/sig99/advanced99/notes/node281.htm , it says that rendering a round point with diameter as same as the width of the lines can solve the problem, but is there the efficient way to rendering a round point?

BTW: can you please show me some samples url for these problems??

Many thanks