Intersection of two geometric objects problem

68 Views Asked by At

Suppose I want to program a zombie computer game. In this game, the protagonist must smash a screwdriver into the zombie's head. If the protagonist attacks, the trajectory of the screwdriver is a 1-dimensional curve $\gamma(t),t \in [0,1]$ in a 3-dimensional euclidean space bounded by the start and endpoint $\gamma(0),\gamma(1)$. Moreover, the zombiehead is a 2-dimensional surface $\Omega$ that has a boundary $\partial \Omega$ (also embedded in this euclidean space). Now there are 3 different outcomes that the game should detect:

  • The screwdricer misses the zombiehead

  • The screwdriver hits the zombiehead only at the boundary

  • The screwdriver hits the zombiehead in the interior of $\Omega$

Given parametrizations of the $\Omega$ and $\partial \Omega$, is there a mathematical expression that does not compute the point of intersection; it does only compute whether the screwdriver intersects or not?

I think about things similar to Gauss linking integral, that is a topological invariant assigning whether two knots are linked or not.

Any help how to assign a boolean variable dependent on the topology of $\Omega,\partial \Omega$ and $\gamma$ would be greatly appreciated.

1

There are 1 best solutions below

0
On

If the head is described by an implicit (in)equation

$$\omega(x,y,z)\le0,$$

by plugging the parametric equation of the screwdriver trajectory,

$$\omega(\gamma_x(t),\gamma_y(t),\gamma_z(t))=\phi(t)\le 0$$

you get a single (in)equation in a single unknown.

There is no general rule to tell if a nonlinear equation has roots in a given interval (but if there is a change of sign between the endpoints, there is obviously at least one intersection).

In the case of a polynomial function, the Sturm theorem answers the question in a finite number of steps, without having to compute them. https://en.wikipedia.org/wiki/Sturm%27s_theorem

If the function $\phi$ has some specific properties, such as the derivative bounded by a known constant, the inexistence of a root can be guaranteed in subintervals, and by a dichotomic process you can exhaust the set of roots.

Have a look at "Guaranteed Ray Intersections with Implicit Surfaces, Devendra Kalra & Alan H. Barr, Computer Graphics, Volume 23, Number 3, July 1989".


The cases where the surface is known by parametric equations and/or the curve as the intersection of surfaces are even harder (systems of nonlinear equations with inequality constraints).