Point-in-Polygon using Ray Casting

Introduction:

This article describes the simplest variant of Ray Casting algorithm for Point-in-Polygon problem.

Problem:

Rosetta Code offers the overcomplicated variant while trying to be generic and robust by:

  • using vector helper macros
  • casting a ray to a random outside point
  • retrying if the ray touches a vertex
  • supporting a polygon with a “hole” by using one connected vertex list

The game should determine the support relationship (surface contact) between 3D objects using geometric tests in limited 3D game environment.

Idea:

W

Benefit:

W

Limitation:

W

Leave a Reply

Your email address will not be published. Required fields are marked *