Rays and Intersections

The way we prevent our avatar from walking through trees is actually quite simple. Imagine an arrow pointing down from our avatar.

images/collisions/ray.png

In geometry, we call an arrow point a ray. A ray is what you get when you start in one place and point in a direction. In this case, the place is where our avatar is and the direction is down. Sometimes giving names to such simple ideas seems silly, but it’s important for programmers to know these names.

Programmers Like to Give Fancy Names to Simple Ideas

images/callout-icons/tip.png

Knowing the names for simple concepts ...

Get 3D Game Programming for Kids 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.