3

In this article: https://www.geometrictools.com/Documentation/IntersectionOfCylinders.pdf

the writer says: "If you plan on using cylinders for bounding volumes in a real-time graphics engine—think twice. A better alternative to a cylinder is a capsule."

Well, I am planning on bounding surfaces with cylinders (actaully I already have). What are the reasonings behind this statement?

Notice - I am mainly interested if two surfaces do not intersect. Some sort of a quick rejection method by bounding the surfaces with solid cylinders.

Eminem
  • 81
  • 2
  • 1
    My guess: computational efficiency. It’s faster to compute the intersection with spherical end caps than planar ones. Probably because with planar end caps you need to first work out the intersection and then have a conditional statement of that is inside the radius of the cylinder. With spherical end caps the conditional is not needed: any hit is inside the radius by definition. – boyfarrell Apr 08 '21 at 08:57
  • @boyfarrell Do you think the difference in performance is something worth looking into? I know you are shooting blind here, but if you could elaborate I would appreciate thate. – Eminem Apr 08 '21 at 09:24
  • Also, spherical end caps might avoid some edge cases in which the hit is edge on etc. I don’t know how to elaborate, maybe tell me exactly what you are stuck on. – boyfarrell Apr 08 '21 at 09:55
  • @boyfarrell I'm not stuck. I'm implementing a surfaces intersection quick rejection algorithm. To do this I've bounded the surfaces with a solid cylinders and made a quick rejection algorithm. The article i've provided says that capsules are better, and I though what should I do. – Eminem Apr 08 '21 at 11:14
  • OK, you could implement both and run timing tests? – boyfarrell Apr 08 '21 at 15:42
  • If your algorithm works for all your cases, then use it. Maybe cylinders are actually better suited for your application, which is why you thought of it in the first place. No problem with that. However, intuitively, it seems like the capsule intersection would be easier on the computer and the programmer.

    "Two capsules intersect if and only if the distance between capsule line segments is smaller or equal to the sum of the capsule radii, a much cheaper test to perform".

    That seems very straight forward to me.

    – Charlie S Apr 16 '21 at 12:25
  • @Eminem how did this turn out for you? love to know anything you discovered/decided – stuart May 03 '22 at 16:11

0 Answers0