Hi,
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?
|
|
0
|
|
|
|
Reply
|
paul_500
|
8/18/2004 10:53:05 PM |
|
Paul wrote:
> 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.
It's possible. Google for "CSG using stencil buffer".
Wolfgang
|
|
0
|
|
|
|
Reply
|
Wolfgang
|
8/18/2004 11:32:24 PM
|
|
"Paul" <paul_500@hotmail.com> wrote in message
news:7e63b55.0408181453.49388c3c@posting.google.com...
>There
> must be a way of doing this as OpenGL calculates the areas of
> intersection when two objects touch.
>
Can you clarify this? I don't believe GL does any such
calculation explicitly, though it might give that illusion via
depth buffer & stencil buffer tests.
You might be able to make use of the polygon splitting
techniques used in forming BSP trees here, though
I'm not sure. BSP trees also faciltate CSG, which
may be a more productive tree to bark up.
Good luck!
Drew
|
|
0
|
|
|
|
Reply
|
Drew
|
8/19/2004 2:36:38 AM
|
|