View Full Version : Area of intersection between two solid primitives

08-18-2004, 02:04 PM

I have a solid cube and a solid cylinder. The cylinder has been translated so that it
makes contact with part of the cube. I need to find a way to display the region of contact
between these two primitives on the surface of the cube and hide the cylinder. Hence if the cylinder intersects the cube head-on, a circle will be shown on the side of the cube.

I've had a look at some CSG tutorials but can't find anything that fits this problem as they all seem to focus on adding and subtracting volumes rather than displaying the surface area of contact. There must be a way of doing this as OpenGL calculates the areas of intersection when two objects touch.

Can anyone help?

08-18-2004, 03:14 PM
This is a subtraction operation in CSG rendering. This link explains how to perform these operations while rendering using OpenGL & the zbuffer & stencil buffer: