View Full Version : a broken donut shape

09-30-2004, 05:02 PM

I need to draw a 3-D donut shape (a ring-shaped tube). Do you think I can draw several cylinders (using gluCylinder()) connecting to form the tube? The only problem I can see is that each cylinder is sliced. I wonder their sliced edges will be continous or discontinous. If the edges are discontinous, then the tube can be easily seen as a set of several smaller tubes, which doesn't look good. Any suggestion? Please help.


Actually, the donut shape I need is broken in the middle (think about a bitten donut). It has a beginning broken face and an ending broken face. Glut or other libraries that support donut drawing probably don't have the function I need.

09-30-2004, 05:14 PM
This is not an Advanced question and isn't even an opengl question.

What you are trying to draw is called a torus.

The following link has some code that draws a torus.
Pauls Projects (http://www.paulsprojects.net/opengl/bumpmap/bumpmap.html)

There are probably dozens and dozens of other examples that can be found through google.