03 - Ray Tracing Flashcards
What’s the “Parametric Representation”
- independent variables
- equations for all variables
- plugging in all permissible parameter values yields structure
e.g.:
x = r * cos(t); y = r * sin(t); t = [0,,2PI)
What is the “Explicit Representation”
- structure represented by a function
e.g.:
y = f(x)
What is the “Implicit Representation”
- structure represented as solution set of system of equations
e.g.:
G = { (x, y) | ax + by + c = 0 ∧ a, b, c ∈ ℝ, a ≠ 0 ∨ b ≠ 0}
What’s the principle of a “Pinhole Camera”? What is based on this principle?
- small hole in wall
- outside light generates mirror-inverted image on inside
-> base for “Virtual Camera”
What defines a “Virtual Camera” (3)
- position and viewing direction
- orientation of vertical axis
- image plane (width, height, distance in front of camera)
What’s “Object-Order Rendering”
- “Rasterization”
- sequence of all objects in scene
- determine pixels, affected by object
- determine pixel color (opacity of objects)
What’s “Image-Order Rendering”
- “Ray Tracing”
- sequence of pixels
- determine objects visible at pixel
- determine pixel color (opacity of objects)
What’s the principle of “Ray Tracing”? Of what parts is “Ray Tracing” made off (3)
- one pixel after another
- view ray from camera through pixel
- first object to intersect is sought
- color for pixel is computed
-> ray generation
-> ray intersection
-> shading
What are “Barycentric Coordinates”
- given k points P1, …, Pk ∈ ℝ^n | (k ≤ n+1)
- Q = 𝜆1P1+𝜆2P2+…+𝜆kPk
-> 𝜆1, …, 𝜆k = “Barycentric Coordinates” of Q w.r.t. points P1, …, Pk
What’s a “Simplex”
- region of points Q where 0 ≤ 𝜆i ≤ 1 holds for the Barycentric Coordinates
How do you calculate the “Barycentric Coordinates” for a triangle
- 𝜆1 = A⊿(Q, P2, P3) / A⊿(P1, P2, P3)
- 𝜆2 = A⊿(P1, Q, P3) / A⊿(P1, P2, P3)
- 𝜆3 = A⊿(P1, P2, Q) / A⊿(P1, P2, P3)
How to check if a point is inside a triangle
- if “Barycentric Coordinates” add up to 1 and are all ≥0
What is the “Barycentric Interpolation”
- colors c1, c2, c3 vertices of triangle
- color cQ at Q with Barycentric Coordinates
How is a “Virtual Camera” defined for “Ray Generation”? How is the image plane defined? How is the “View Ray” defined?
Virtual Camera:
- e: position (= projection center)
- z: aim point
- up: up vector
- w: negative view
- u = up x w
- v = u x w
Image Plane:
- d: distance to camera
- l: left border
- r: right border
- b: bottom border
- t: top border
- s: aim point (between borders of image plane)
View Ray:
r(t) = e + td | d = (s - e) / ||(s - e)||
How to calculate intersection point(s) of ray and sphere
- parametric ray representation
-> r(t) = e + td - implicit representation of sphere
-> ||x - c||^2 - r^2 = 0 - plug in ray for x
- solve for t