If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

### Course: Precalculus (Eureka Math/EngageNY)>Unit 2

Lesson 7: Topic E: First-person video games—projection matrices

# 1. Ray tracing intuition

First, let's look at ray tracing in 2D using a simple example. In 2D, an image line is formed from the camera location and the viewing direction. When a pixel's color is being determined, a ray is built from the camera, through a point on the image line, and off into the scene. Let's look at the algebra of intersecting a ray with a line segment!

## Want to join the conversation?

• at why is line C never ending even if Susan said it is a line segment
• Just because the end of the ray C is not visible in this example does not mean it never ends. In practice, the ray used for tracing does have a maximum length. Look up clipping planes.
• I was doing the practice for 2nd rendering intuition and I did the first question correctly and hit the check box. It wouldn't let me move onto the next question. Any tips on how to fix this?
• How the camera view direction determines the image plane or the image line? I thought they were perpendicular to each other. But it seems not.
• Aren't pixels: red, green and blue?
• Hi there!

I'm really excited to get into ray tracing, but I have one question.

So, when we send a ray through the Image Plane into the unknown, we check for intersections between objects (triangles probably).

Then, we need to find the color of that point. We send off some rays in the direction of the light source, reflected direction, refracted direction, ect.
But all that does is effect the color of the object, that doesn't actually tell us what color the object is.

So great, we got some cool things going on, we have some reflected light, but how do we know that the color is?

In real life, object absorb lights of certain wavelength, meaning they absorb some of the light, and reflect the others.

What do we do in ray tracing? Do we just set each point to a color, and then when our ray intersects with that point, we send off some rays to reflect on it to effect it, and then calculate the final color (that was shaded by adjacent lights & colors)?

This was a bit of a mouthful, but I hope I can get a nice answer.

Thanks! :-)