BConic
BConic

Reputation: 8980

Detecting 3D collision between a triangle and a rotating sphere

My problem:

enter image description here

Consider a little green sphere constrained to move only on the surface of a large yellow sphere of center O. The green sphere is initially at point C0 and is following a command motion with 2 degrees of freedom.

Then, at point C1, the sphere collides with a red object (e.g. a triangle). This is a non-elastic friction-free collision, which basically removes one degree of freedom from the motion of the green sphere.

However, the green sphere still tries to follow its command trajectory. Since there is still one degree of freedom, the motion of the sphere will be modified and it will go towards C2.

My questions:

How should I approach the problem of designing an algorithm to detect the collision between the green sphere and the red object (in particular, when the object is a 3D triangle), when the motion of the green sphere is constrained to be on the yellow sphere ?

Once the collision is detected, how can I compute the residual/reaction trajectory of the green sphere after the collision ?

Note that I am aware of algorithms to detect 3D collisions between moving spheres and triangles in the case of 3D translations. How would I handle a constrained motion, such as rotation at fixed length from a fixed point?

Upvotes: 1

Views: 555

Answers (2)

user1196549
user1196549

Reputation:

Use the following trick to address this problem of tangency: deflate the green sphere to a point (radius 0), and at the same time inflate the yellow sphere (radius R+r) and the red triangle (fat triangle of thickness 2r and cylindrical edges/spherical corners).

The green sphere touching one original surface is now understood as the green point belonging to the corresponding inflated surface.

So your point initially runs on the inflated yellow sphere, until it meets the surface of the inflated triangle; then on, it follows the intersection of both surfaces.

The exact curve depends on the particular relative positions of the sphere and the triangle, and you will have to consider the possible intersections of the sphere with 2 planes (=> circular arcs), three cylinders (=> complex quartic curves) and 3 spheres (=> circular arcs), and discuss the endpoints of these curves.

All this is tractable analytically, but probably painful.

The intersection curve below shows the trajectory of the center.

enter image description here

Upvotes: 1

user3386109
user3386109

Reputation: 34839

According to the flat-earth society, if the yellow sphere is the earth, and the green sphere is a person walking on the earth, then an observer 10 meters above the person sees the person as walking on a 2D plane. Mathematically, the curvature of the yellow sphere is negligible when considering infinitesimal distances around C1, so the motion of the green sphere can be modeled as if moving on a plane. Specifically, the motion appears to be in the plane tangent to the sphere at point C1.

The colliding object can be imagined as a wall embedded in the surface of the earth. When the person reaches the wall, they must follow the wall. Mathematically, the intersection of the triangle with the tangent plane forms a line on the plane which the green sphere must follow.

Thus, to an observer looking down at point C1, the situation looks like this enter image description here

where
. P is the plane tangent to the sphere at point C1
. L is the line formed by the intersection of the triangle with P
. the dark blue line is the original direction of motion
. the light blue line is the new direction of motion

So my approach to the problem would be:

Translate and rotate the coordinate system so that
. C1 is at point (0,0,0)
. the center of the yellow sphere is at point (0,0,-r)
This means that P is the XY plane, i.e. the plane with z=0.

Determine the equation of the plane of the triangle in the new coordinate system, in the form
ax + by + cz + d = 0. The equation for L is then ax + by + d = 0

The new direction of motion is parallel to L, which you must then rotate and translate back to the original coordinate system.

Upvotes: 1

Related Questions