Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Translucent cylinder

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2004
    Posts
    16

    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?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2004
    Location
    Long Island, New York
    Posts
    570

    Re: Translucent cylinder

    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.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2004
    Posts
    16

    Re: Translucent cylinder

    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 ;-)

    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)

  4. #4
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: Translucent cylinder

    GIMP

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2004
    Posts
    16

    Re: Translucent cylinder

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •