[Resolved] Filling Glass with Objects (Graphics Question)

Lets say I want to make a simple app where a ‘glass’ object gets filled with other objects. Like a glass cup that fills with glass balls. How do I visually put the balls inside of the glass?

I can’t make the glass cup transparent because it wouldn’t look like glass anymore, if I just leave it as the png the balls go behind the front of the glass visually since I made the object with just the walls and no top.

Anything would help, theory, code, or doc links. I just don’t even know where to start.

Thanks in advance.
[import]uid: 95498 topic_id: 28277 reply_id: 328277[/import]

You could make and use two versions of the glass image. The first glass goes behind everything and can be opaque. Then the balls images are poured on top of that. Then on top of that is layered the second glass image, similar to the first version with perhaps the highlights opaque and the rest of the glass mostly transparent. You could also make the edge “thickness” of the glass opaque as well. The combined effect would be such that the balls will look like they are behind the front surface of the glass. [import]uid: 9422 topic_id: 28277 reply_id: 114244[/import]

Thanks that really helped out, I was thinking way to complex and was getting lost. I ended up getting it to work by making the first glass at about 80% opacity so you could see the background though it. The top glass is set to 40% to make it look like the objects are in the jar. [import]uid: 95498 topic_id: 28277 reply_id: 114255[/import]