











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












So far, you have learned to build a “passive”
renderer
What happens when a user wants to manipulate
the objects in the scene?
A. which object the user clicked on?
B. where on the object the user clicked on?
Motivation
Ray intersection with the nearest object in the scene No intersection
What is a Ray Tracer?
There are three parts to a ray tracer:
Shoot a ray from the eye through a sample point on the film plane that corresponds to a pixel Repeat the process for each pixel
For each object in the scene, compute their intersection point (if one exists) Record the closest intersection point to the eye
Use illumination model to determine direct contribution from light sources (For recursive ray tracer), recursively generate secondary rays that might contribute to the color of the pixel (e.g., reflective surfaces or mirrors need to reflect other objects in the scene)
Ray Tracing Fundamentals
Ray tracing uses the following pseudocode:
for each sample (pixel) on the film plane
Note the distinctions:
Ray Tracing vs. Scan Conversion
Let’s look at the geometry in the world space coordinate
Step 1: Generating a Ray (Solution 1 – World Coord)
P is the ray’s origin (eye point) d is the unit vector in the direction of the ray t is a non-negative real value
Q
Now that we have the point
Q, can we find this other
point S?
How do we find a and b?
Step 1: Generating a Ray (Solution 1 – World Coord)
S
S Q
(a, b)
Step 1: Generating a Ray (Solution 1 – World Coord)
S Q
(a, b)
Step 1: Generating a Ray (Solution 1 – World Coord)
Questions?
Step 1: Generating a Ray (Solution 2 – Camera Coord)
Remember that we need to apply this inverse
matrix to the two points that make up the ray
Don’t forget to normalize the resulting ray vector
Step 1: Generating a Ray (Solution 2 – Camera Coord)
Questions?