CSCE 441 Lecture 24
« previous | Wednesday, March 19, 2014 | next »
Surfaces
Implicit
Defined by a function; points are not directly defined.
For example, a sphere is defined by the function
Shapes that are easy to define implicitly are:
- spheres
- planes
- cylinders
- cones
- tori
These types of shapes are easy for raytracers to handle.
Intersections
Given a ray that starts at a point and extends to infinity in the direction of , find the intersection of with :
Substitute for in the function and solve for in .
Example: and
The solution to the intersection is , so and .
Normals
Given , find the normal at a point
Assume we have a parametric curve on the surface of , we set and differentiate with respect to :
This represents conceptually the dot product between what must be the normal of the surface and the slope of a line on the surface (i.e. must be tangent to the surface)
Summary
Advantages
- easy to calculate intersections and normals
Disadvantages:
- hard to calculate points on the surface
Parametric
Intersections
Set , and solve a system of three equations (each of , , and ) for the parameters , , and .
Plug parameters back into equation to find solution.
Example: and
Normals
Assume is fixed. Set and differentiate with respect to :
The RHS represents the tangent at
Perform a similar operation with :
The RHS represents the tangent at .
To find the normal, take cross product of tangents:
Summary
Advantages:
- easy to generate points on surface
Disadvantages:
- hard to determine if point is inside or outside
- hard to determine if point is on the surface
Deformed
Given a surface and a deformation function , is a new surface representing the deformed surface.
This is useful for creating complicated shapes from simple objects.
Intersections
- Assume is a simple matrix (e.g. affine transformation)
- First deform by Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle D^{-1}}
- Calculate intersection with undeformed surface Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle S}
- Transform intersection point and normal by Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle D} .
Example: deformation of a circle that stretches by factor of two in the Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle x} direction: Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle D(x,y) = (2x, y)}
Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle L(t) = (-1,-1,1) + (1,1,0) \, t}
Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle D^{-1}(L(t)) = \begin{bmatrix} \frac{1}{2} & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \, \left( \begin{bmatrix} -1 \\ -1 \\ 1 \end{bmatrix} + \begin{bmatrix} 1 \\ 1 \\ 0 \end{bmatrix} \, t\right)}
Normals
Define how tangents transform first. Assume Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle C(t)} is a curve on the surface:
Tangents deform by applying transformation Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle D}
(multiply by matrix)
Normals and tangents are orthogonal both before and after transformation.
Let Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle N} be the normal and Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle T} be the tangent:
Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \begin{align} (M\,N)^T \, D \, T &= 0 \\ N^T \, M^T \, D \, T &= 0 \\ N^T \, \left( M^T \, D \right) \, T &= 0 \\ M^T \, D &= I \\ M &= D^{-T} \end{align}}
Hence
(why? normal vectors are covectors, not vectors)
Summary
Advantages
- simple surfaces can represent complex shapes
- affine transformations yield simple calculations
- If we are given Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle D^{-1}} , we never have to compute any matrix inverse.
Disadvantages