PDA

View Full Version : intersecting plane with object



mikemor
10-21-2002, 08:04 AM
Is there any way in opengl of finding whether a given plane intersects an object in a scene (without doing explicitly the math). Maybe with opengl in selection mode?

coredump
10-21-2002, 08:16 AM
yoo could probably do it faster yourself with polygon/plane intersection routines.

b

mikemor
10-21-2002, 08:24 AM
Yes but it would be a (math) nightmare. It should be possible to have opengl find which polygons intersect a given polygon. But how????

jwatte
10-21-2002, 08:47 AM
OpenGL is a black box. You put data in. Out come pixels on the screen. If you're trying to do anything other than that, you really shouldn't be using OpenGL, because either it's not supported at all, or it's only poorly supported.

Try this link for information on collission/penetration detection:
http://www.magic-software.com/

j
10-21-2002, 09:20 AM
If you are just trying to find out if the plane intersects the object, and don't care about where the intersection happens, it's easy to do. Just check if the plane divides the set of points that correspond with the vertices of the object. To do this, go through the list of points. Record which side of the plane the first point is on, and if any of the other points are on the other side of the plane, the plane intersects the object. The algorithm is O(n) in the worst case, and O(2) in the best case.

j

Coconut
10-21-2002, 09:35 AM
Originally posted by mikemor:
Yes but it would be a (math) nightmare. It should be possible to have opengl find which polygons intersect a given polygon. But how????

I like to think of this way: Why would OpenGL care to know which two polygons are intersecting?