Translucent cylinder

Is there any way to apply a gradient translucency to a gluCylinder? What I want is a cylinder that is completely opaque at one end and completely transparent at the other. The only way I’ve come across performing such gradient fills is by specifying vertices with the transparency at each one but how do I do this with gluCylinder?

Create a 32bit RGBA texture that is the gradient you want. for example you could use the gradient tool in photoshop and create a texture going from white to transparent (white is a good choice because then you can choose the color in OpenGL space using a call to glColor* before you render the cylinder).

apply this texture to your cylinder using GL_MODULATE and voila, you’ve got your cylinder going from opaque to transparent.

Thanks,

Is there any chance you could post an example? From what you say it sounds very easy, but I’ve had a look at a couple of tutorials which make texture mapping look fairly involved… I need a quick solution :wink:

I downloaded Photoshop Tryout Version 6 but there doesn’t seem to be an option to save anything… do you know of any other package I could try which lets me create textures? (preferably one that’s free for download)

GIMP

Thanks