Interference/collision detection

Is there any way to find the interference of two objects?
Say, I have sphere and a plane. When the sphere move through the plane, I would want to know the intersected area at any given time. Is that possible?

I have tried using collision detection but it only gives a single point where the sphere first collide with the plane and the point remain the same when i moved the solid through the plane.

Thanks in advance!

The collision system in Panda3D really is just a collision detection, not a full-blown computational geometry library. Perhaps you can find other Python libraries that can do this. Perhaps take a look at whether there are Python bindings for CGAL.

1 Like

how about doing it manually?

if I am loading .bam/.obj file using loader.load(), is there a method to get points of the object? So I would be able to compare the coordinates of each points on the sphere with the plane. Thanks!

If you are specifically using a sphere and a plane, and a mathematical approximation of the geometry is acceptable, then it should be possible to calculate the intersection of a mathematical sphere and plane that match your geometric sphere and plane.

If you do want to examine the vertices, while I don’t know whether the following is the best approach–I defer to the expertise of others here–the GeomVertexReader class might be of use to you.

In fact, I see that we have a detailed manual page on the topic of reading vertex data–you should find it here.