View Full Version : How to make tubes?

02-13-2002, 10:48 AM

I have made a torusknot using GL_LINE_STRIP, and now I would like to know how to make the line look like a tube, so the torusknot would look thick.


02-13-2002, 02:40 PM
ps i havent tried this but it should work
if your lines lay on a plane then take the cross product of the up vector and a line segment, normalize this and store it, then take the cross product of the up vector and - the up vector and store it then store the point + the up vector and the point- the up vector this will get you the points for a square at each line segment.
Joing these up will make a square tube.

If you want furthur vertices for the circle on that segment just substitute the values just found in the equation of a circle and get more points that way.

Another way is to use quadratics (i think there using the glaux library) just rotate and translate cylinders straight onto your lines easier but not yr own work http://www.opengl.org/discussion_boards/ubb/smile.gif

02-14-2002, 02:39 PM
Try this.

GLE Tubing and Extrusion Fact Sheet

02-15-2002, 01:08 AM
nice, although u cant claim you wrote it http://www.opengl.org/discussion_boards/ubb/smile.gif

02-16-2002, 05:40 AM
Mr_Smith: I didn't claim I wrote it.

02-17-2002, 04:59 AM
tru, but its nice to know u wrote it