A
A
Alexander2020-07-31 19:27:24
JavaScript
Alexander, 2020-07-31 19:27:24

How to detect the intersection of two 3d objects?

There are 2 parallelepiped objects, each of them has the coordinates of 8 corners, or the coordinates of the center (x, y, z), rotation (x, y, z) and dimensions (x, y, z - width, height and length) are also known . What will the function of checking whether they intersect in space look like or not?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Developer, 2020-07-31
@samodum

Here you need to know the geometry of the objects, and not their center and transformation matrices.
You also need to know what primitives they consist of. If it is a sphere, then there is only one algorithm, if the object is complex and consists of a set of planes (triangles), then it is necessary to check the intersections of each of these microplanes.
If this is OpenGL, then the problem is solved through Stencil Buffer
In short, there is sooooo little data to answer the question.
To simplify, you can "fit" objects into a sphere or box and check for collisions of these simple objects. This is already school geometry, 6th grade.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question