Discussion:
Showing the area of intersection between two or more primitives
(too old to reply)
Paul
2004-08-18 22:53:05 UTC
Permalink
Raw Message
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?
Wolfgang Draxinger
2004-08-18 23:32:24 UTC
Permalink
Raw Message
Post by Paul
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
Drew Hall
2004-08-19 02:36:38 UTC
Permalink
Raw Message
Post by Paul
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
imenimou
2014-02-03 05:32:12 UTC
Permalink
Raw Message
hi paul
i've a problem to make a cube with matlab nurbs have you any idea how to do it plz thnx ;)
Loading...