Results 1 to 2 of 2

Thread: transparency problems

  1. #1

    transparency problems

    Hi everyone,

    I've designed a GUI using openGL which involves positioning a small sphere on the surface of a large sphere using mouse input. I've written the code so that a left mouse click will position the object on the 'near' side of the sphere - no problem there. And with a right mouse click it will position it on the 'far' side of the sphere - i.e. behind the sphere. But I still want to be able to see the small sphere when its behind, so I thought to use some transparency. I've used glColor4f to give the large sphere an alpha value of 0.5, while the small sphere has an alpha value of 1.0. But when I move the small behind the large, it still disappears! As far as I know I've activated all the necessary blend function, depth buffer, depth testing, etc. Can anyone think where I might be going wrong??? Or do I need to give more information?


  2. #2
    Senior Member Regular Contributor
    Join Date
    Feb 2001

    Re: transparency problems

    You have to draw your objects back to front (furthest away first), or maybe draw the large sphere, disable depth testing and draw the small sphere behind. The reason it isn't showing up is because the depth test says the small sphere is behind the large one so shouldn't be drawn.

    Hope that helps.

Similar Threads

  1. Texture transparency problems
    By mad jak in forum OpenGL: Basic Coding
    Replies: 8
    Last Post: 03-12-2011, 01:07 AM
  2. Transparency problems
    By SnakedeVirgo in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 12-03-2008, 10:43 AM
  3. order independent transparency problems in NVIDIA 8XXX GPUs
    By yalmar in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 07-10-2007, 08:46 AM
  4. Transparency Problems
    By Carolann in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 09-01-2005, 09:20 PM
    By jjcheng in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 07-01-2005, 12:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean