Drawing lines with changing width

I am looking for a way to draw 3D lines with changing width. I know that i can create triangles, as in the following tutorial: Drawing smooth lines with cocos2d ios inspired by Paper

However, it will not look good in 3D when camera is rotated. Is there a good way to draw 3D lines with changing width?

Depends on what OpenGL version you’re using. There’s a glLineWidth() call that you can use to set the line width. It’s still supported in the core profile, but marked as deprecated. So you won’t be able to set a line width larger than 1.0 in a forward-compatible core profile context.