Advertisement

Collision detection against curved surfaces

Started by February 02, 2000 09:37 AM
1 comment, last by delphi3d 24 years, 10 months ago
How do you perform collision detection against a bezier surface? I have code to test bounding boxes against rays, triangles and other boxes, but I haven''t yet figured out a way to handle bezier patches. The problem is that I only have the control points - I leave the surface tesselation to OpenGL, so I can''t just subdivide the surface into triangles and test those. Any ideas? Tom Nuydens delphi3d@gamedeveloper.org www.gamedeveloper.org/delphi3d
Tom Nuydens delphi3d@gamedeveloper.org www.gamedeveloper.org/delphi3d
Erg! The only way I see it is to do some tesslation of the surfaces. Triangles seem inneficient, but I believe you could use curves extapolated at the control points in one axis.
[I''m going to need all the help I can get on this one, everybody.]
_Presuming a "grid" of control points: At each interval where there is a contol point along one axis, tesslate a series of line segments for the curve running along the crossing axis. Repeat for the other surface. Set one surfaces set of curves as a "test-against" for the second''s and normalize the coordinates to the first surface''s oriantation.
_I probably lost you with the oriantation, so here''s a more detailed explanation. Each tesslated curve [group of line segments] has a plane. Before testing against each curve, normalize the coordinates to that curve. Hmm, this might be rather inneficient in itself if you do normalize esch time. Try it both that way and to the curves internal axes.
_[Anyways] You then check the second surface''s curves against the first''s by running along an axis, testing at intervals as to whether the curves crossed. Do this by inputing the "X" into the second curve and get it''s "Y" and "Z."
_I hope I haven''t confused the living daylights out of you. Maybe I''ll post some diagrams if I get the cahnce.
Advertisement
It seems I didn''t make myself very clear... I don''t want to detect collisions between to bezier surfaces (yet), but between a bounding box (OBB) and a surface.

Tom Nuydens
delphi3d@gamedeveloper.org
www.gamedeveloper.org/delphi3d
Tom Nuydens delphi3d@gamedeveloper.org www.gamedeveloper.org/delphi3d

This topic is closed to new replies.

Advertisement