Day 13 - Ray Tracing I
What do I need as a minimum to render an image?
How do we define these things in code?
- Look at direction
- FOV field of View
- Camera Up vector
- Sun, direction to light
- Spheres, Origin + Radius
Ray + Sphere intersection
- Line Segment
- Ray, Camera origin off to infinity
- Origin + Direction * t
- If the discriminant is negative.... We didn't hit the sphere.
- If not we hit the sphere (but maybe by going backwards)
Ray + Sphere Collisions
- a = dot(d,d)
- b = 2 * dot(d, sub(o,center))
- c = dot(sub(o, center), sub(o,center)) - (r * r)