6POLYGONS
Our next primitive, polygons, builds on points and segments. Polygons can be used to describe colliding geometries, portions of the screen that need redrawing, body boundaries, and much more. It turns out these primitives are extremely useful when it comes to processing images, as you can use them to figure out whether different parts of the image overlap. In dynamics simulations, they help determine when two bodies collide. In user interfaces for graphic-intensive applications, you can use simple polygons to easily figure out whether the user’s mouse is over an entity that may be selected.
In this chapter, we’ll be implementing three ...
Get Hardcore Programming for Mechanical Engineers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.