I’ve drawn a 3D hollow cylindrical tunnel type of shape using
glBegin(GL_QUAD_STRIP); I want the walls to have some thickness, but I don’t want to just draw a slightly smaller tunnel inside the tunnel…I want it to be completely solid so that if I were to then clip off the ends with two clipping planes, I would still see a thickness and not the appearance of one cylinder inserted into another…
can anyone help?

I know that glLineWidth() can be used to make thicker lines, does this work for shapes also. i.e. could I draw squares of a specified thickness using glBegin(GL_QUADS) ??

[This message has been edited by Rajveer (edited 04-18-2002).]

A polygon is an infinately thin surface.

I see…
so is there any other way to give the shape thickness?

Originally posted by Gavin:
A polygon is an infinately thin surface.

You could search the web for CSG, constructive solid geometry. I haven’t use CSG much, but I believe you can simulate thickness with some of the operations you can do.

Sorry, but I can’t provide much usefull information on the area, but I have a feeling it should be doable with the help of some CSG. Maybe someone else here can give some more info.

Use two gluCylinder and two gluDisk:

The disk can have a hole in it, so you make the disk the end’s pices of you cylinder. The diffrence between the ID and OD is your thickness.
The outside cylinder will be the same as the disk’s OD (outer diameter), and the inside cylinder will be the same size as the ID (inner diameter).


**************** Outer Cylinder, normals map out.
**************** Inner Cylinder, normals map inward


Originally posted by Rajveer:
[b]I see…
so is there any other way to give the shape thickness?


[This message has been edited by nexusone (edited 04-18-2002).]

nexusone, I’m not sure that’s what Rajveer is looking for. See, if you move your viewpoint very close to your cylinders, so close that the near plane will clip the outer and inner cylinder, you will see the space between the two cylinders. Your cylinder is still hollow, a surface with nothing inside. I belive Rajveer want’s a solid inside, and then you must, manually, fill the holes caused by the clipping.


you could also whats on

-with z-buffering on (always)
-clear stencil, color, depth buffer
-draw the scene, front facing polys only
-turn off color writes
-set stencil to increment
-draw the scene, back facing polys only
-turn on color writes
-set stencil function to GL_EQUAL to 1
-normalize states(turn off stenciling, etc)

the CAPPING POLYGON is a quad(or 2 tris) that covers the entire screen. that poly will only be drawn where the inside of the scene can be seen. the disadvantage is that you get only one interior texture for the whole scene.

the level geometry must be absolutely hollow hulls, no loose polys into them, or it will look weird.

ideas? comments?