How to draw joined-up, thick line segments

Hi forum,

I’m using ofDrawLine along with ofSetLineWidth(7). The result looks like this:

The line segments don’t connect to each other in a fluid way. I’ve found some addons like ofxSmoothLines or ofxFatLines that look promising but they are a bit old and don’t compile in the latest OF.

I also found ofxShivaVG which sounds great and is a whole graphics library, but again it doesn’t compile in the latest OF.

I’m wondering what other people are using? I could start pulling these addons apart and debugging them, but I wonder first if people in the know are using something else?


I would go for ofPolyline, have a look at this tutorial

opengl line drawing is always problematic.

this code example might help – it’s a very simple way of drawing thick lines by offsetting the line and making a mesh out of it.

I’ve had good luck with shiva vg maybe one of these later branches can help? I see some 0.9 specific things…

1 Like

Absolute total overkill, but the links below have some code to take a set of points and make a tube out of it, draw that without lighting and you have yourself thick lines.

I haven’t done any documentation for the overall repo yet, (it needs ofxFbx develop branch), though I should have that up tomorrow, but the Lathe object should be pretty easy to use, if you have a read through the file ofApp.cpp below hopefully it’ll make sense.

Thanks all, these links are really helpful!

@zach, you are right, edwardloveall’s fork compiles in 0.9. I’ll dig into Shiva further.