PDA

View Full Version : create pipes with gluCylinder



beginner620824
02-22-2003, 02:41 AM
I want to draw a pipe by using gluCylinder.
We know each turning point along the pipe. I will call the part between two neighbouring points a sectoin (sorry, i am mot a native english speaker) which is to be created by using cylinder.
My idea is : hold one end of the cylinder at the start point of the section while rotate the cylinder so the other end of the cylinder will reach the end point of the sectoin. and one by one these sections join into a pipe.
But i really get lost with the rotation fuction( especailly when more than one coord parameters taking non 0 values)
or is there a better solution( if i don't have to create the sectoin myself)

Thanks

nexusone
02-22-2003, 03:38 AM
Look for the code for the windows pipes 3D screen saver, it uses openGL and thoese other early 3D screen savers also.

Microsoft ship the source code for it on the VC++ CD, I somewhere around here laying around maybe I will find it for you.
I may even having burried in my hard drive!!!



Originally posted by beginner620824:
I want to draw a pipe by using gluCylinder.
We know each turning point along the pipe. I will call the part between two neighbouring points a sectoin (sorry, i am mot a native english speaker) which is to be created by using cylinder.
My idea is : hold one end of the cylinder at the start point of the section while rotate the cylinder so the other end of the cylinder will reach the end point of the sectoin. and one by one these sections join into a pipe.
But i really get lost with the rotation fuction( especailly when more than one coord parameters taking non 0 values)
or is there a better solution( if i don't have to create the sectoin myself)

Thanks

beginner620824
02-22-2003, 04:29 AM
hi Dear nexusone:

Thank you very much.If you can find the code, please mail it to me:
frank.ya@163.net

Best regard

Liuya, i am a guy in china

beginner620824
02-22-2003, 04:27 PM
but one thing different from Windows pipes is that my pipe wants to make turn at any angle while the window's pipe make 90 turn and the sections always stay in one plane.

J P
02-23-2003, 07:48 AM
Use GLE (Tubing and Extrusion). It is distributed with GLUT and is more general.
http://linas.org/gle/