Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have a list of points (3D) and want to draw a line connecting all points with a specified width. The line should be rendered in OpenGL (using OSG) as triangles. The real challenge of this task is to make the line look "pleasant" for the user; meaning the joints should be round.

It should be similar to this:

enter image description here

Is there any library which brings this functionality?

share|improve this question
    
So you want a smooth curve through those points? Look into bezier curves. –  doppelgreener May 10 '12 at 10:03
    
No, i don't want a smooth curve though the points. I just want a 'think' line connecting the points with good locking joints (especially without spikes) –  Andreas Roth May 10 '12 at 10:14
    
Could you post an example of what you want? –  doppelgreener May 10 '12 at 10:22
    
added a link to similar code for 2d lines –  Andreas Roth May 10 '12 at 12:32
    
There's lots of things in this link. My unserstanding is that you're only interested in rounded joints, like this: vaserenderer.sourceforge.net/blog/vaserendererdraft12/…. Am I right? –  Laurent Couvidou May 11 '12 at 14:02

2 Answers 2

I'm not sure you should go through the burden of using a library just for rounded joints. You could draw thick lines with discs at the intersections, i.e.:

Sketch

share|improve this answer
    
+1 - this is the most straightforward approach. Note that since the user is talking about line drawing in 3d, the 'thick lines' should actually be cylinders and the discs should be spheres since they could be being looked at from any angle; if users will be inspecting the lines up close then you'll have to be a little bit careful about polygonalizing your shapes (especially your sphere) to avoid cracks where the cylinders merge into the sphere. –  Steven Stadnicki May 15 '12 at 20:25

In the CAD world a rounded corner like you describe is called a Fillet while a hard angled transition is called a Chamfer. Since you are dealing with lines, which is a CAD specialty, see if anything here: Discussion on CAD libraries has something you can use.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.