View Full Version : How to make tubes?

teemupii

02-13-2002, 10:48 AM

Hi

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.

Thanks

Mr_Smith

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

Try this.

GLE Tubing and Extrusion Fact Sheet

http://linas.org/gle/index.html

Mr_Smith

02-15-2002, 01:08 AM

nice, although u cant claim you wrote it http://www.opengl.org/discussion_boards/ubb/smile.gif

Mr_Smith: I didn't claim I wrote it.

Mr_Smith

02-17-2002, 04:59 AM

tru, but its nice to know u wrote it

Powered by vBulletin® Version 4.2.5 Copyright © 2018 vBulletin Solutions Inc. All rights reserved.