Say we have a 3d
space, Line segment defined by its start and end points (A
{Ax, Ay, Az}
, B
{Bx, By, Bz}
) and cylinder defined by its center position C
{Cx, Cy, Cz}
, radius R
and height H
. How to get a fact of intersection and if intersection happened than where?
Try this. Google for the win - the answer is even here on SO. This even has source code and links to more information for you to use. With just a little bit of searching, you could have got this yourself.
This is based on @DuckQueen's answer - it just adds projecting the intersection point - if any - to see if it falls within the height of the cylinder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With