View Full Version : Overlapping Shapes

11-30-2011, 01:02 PM
I'm new to Open GL and I've been assigned a project where if there are overlapping circles, the overlapping portion must be a specific color (specified by an external source). Is there anyway to specify this or implement this? I've played around with glBlendFunc but that's not doing the trick.
I've considered drawing another shape over that area, but the math for that isn't simple because the circles could dynamically be located anywhere, and have any radius.

carsten neumann
11-30-2011, 04:16 PM
Since it's a class project here is a hint: this idea

I've considered drawing another shape over that area

is on the right track. Look into what the stencil buffer can do to avoid having to calculate the overlap area yourself.