Skip to content

Files

Latest commit

ad5a40d · Jul 8, 2018

History

History
542 lines (500 loc) · 25.7 KB

cs341.md

File metadata and controls

542 lines (500 loc) · 25.7 KB

You can't use 'macro parameter character #' in math mode

$$
\def\norm#1{||#1||}
$$

CS341

GNU General Public License v3.0 licensed. Source available on github.com/zifeo/EPFL.

Spring 2016: Introduction to Computer Graphics

[TOC]

Introduction

  • computer graphics
    • rendering : generate an image from a digital representation of a 3D scene, realtime rendering (OpenGL)
    • modeling : build digital representation of 3D scene, procedural methods
    • animation : how to bring a 3D scene to life
  • raster image : 2D array of pixels (picture elements), color/bit #bits/pixel
  • fundamental components
    • geometry primitives : points and line segments, triangles
    • transformations : object, world, eye coordinates
    • projection and viewing : perspective, orthographic
    • rasterization : pixelisation
    • visibility : z-buffer
    • shading : vertex, fragment, geometry, tessellation shaders
      • vertex : individual vertices, transformations, lighting
      • fragment : individual fragments (pixel), lighting, specular highlights, translucency, bump mapping, shadows
      • geometry : whole primitives, points sprites, cube mapping
      • tessellation : subdivide vertex data into smaller primitives, level of detail
  • OpenGL
    • pipeline
    • geometry primitives
  • GLSL : shader programming
  • graphics pipeline

Rasterization

  • 2D canvas
  • implicit functions
    • on curve : F ( x , y ) = 0
    • inside curve : F ( x , y ) < 0
    • outside curve : F ( x , y ) > 0
    • circle : F ( x , y ) = ( x c x ) 2 + ( y c y ) 2 r 2
  • simple rasterization
for all pixels (i,j)
	(x,y) = map_to_canvas (i,j)
	if F(x,y) < 0
		set_pixel (i,j,color)
  • barycentric coordinates : P = α A + β B + γ C with α + β + γ = 1

    • linear function : α ( P ) , β ( P ) , γ ( P )
    • unique : for non-collinear ABC
    • matrix form : $\begin{bmatrix}A_x & B_x & C_x \\ A_y & B_y & C_y \\ 1 & 1 & 1\end{bmatrix}\begin{bmatrix}\alpha\\ \beta\\ \gamma\end{bmatrix}=\begin{bmatrix}P_x\\ P_y\\ 1\end{bmatrix}$
    • ratio of triangle areas
  • barycentric rasterization

    • triangle : ( x 0 , y 0 ) , ( x 1 , y 1 ) , ( x 2 , y 2 ) points with α , β , γ > 0
    • incremental algorithm : scan line, optimized hardware
    • interpolation : n ( P ) = α n ( A ) + β n ( B ) + γ n ( C )
for all y do
	for all x do
		compute (α,β,γ) for (x,y)
		if α ∈ [0,1] and β ∈ [0,1] and γ ∈ [0,1]
			set_pixel (x,y)

2D transformations

  • linear maps
    • general : $\begin{pmatrix}x' \\ y'\end{pmatrix}=\begin{pmatrix}a & b\\ c & d\end{pmatrix}\begin{pmatrix}x\\ y\end{pmatrix}$
    • combination : L 2 L 1 x
    • scaling : $\begin{pmatrix}x' \\ y'\end{pmatrix}=\begin{pmatrix}s_x & 0\\ 0 & s_y\end{pmatrix}\begin{pmatrix}x\\ y\end{pmatrix}$
    • rotation : R ( α ) , $\begin{pmatrix}x' \\ y'\end{pmatrix}=\begin{pmatrix}\cos\alpha & -\sin\alpha\\ \sin\alpha & \cos\alpha\end{pmatrix}\begin{pmatrix}x\\ y\end{pmatrix}$
    • x-axis shear : H x ( a ) , $\begin{pmatrix}x' \\ y'\end{pmatrix}=\begin{pmatrix}1 & a\\ 0 & 1\end{pmatrix}\begin{pmatrix}x\\ y\end{pmatrix}$
    • y-axis shear : H y ( b ) , $\begin{pmatrix}x' \\ y'\end{pmatrix}=\begin{pmatrix}1 & 0\\ b & 1\end{pmatrix}\begin{pmatrix}x\\ y\end{pmatrix}$
  • affine maps
    • general : $\begin{pmatrix}x' \\ y'\end{pmatrix}=\begin{pmatrix}a & b\\ c & d\end{pmatrix}\begin{pmatrix}x\\ y\end{pmatrix}+\begin{pmatrix}t_x\\ t_y\end{pmatrix}$
    • combination : L x + t
  • homogenous coordinates : matrix representation of affine transformations, w -coordinate
    • 2D point : ( x , y , 1 ) T
    • 2D vector : ( x , y , 0 ) T
    • general : $\begin{pmatrix}x'\\ y'\\ 1\end{pmatrix}=\begin{pmatrix}a & b & t_x\\ c & d & t_y\\ 0 & 0 & 1\end{pmatrix}\begin{pmatrix}x\\ y\\ 1\end{pmatrix}$
    • combination : important for performance, $A_n\cdots A_1\begin{pmatrix}x\\ y\\ 1\end{pmatrix}$
    • scale : $S(s_x,s_y)=\begin{pmatrix}s_x & 0 & 0\\ 0 & s_y & 0\\ 0 & 0 & 1\end{pmatrix}$
    • rotation : $R(\alpha)=\begin{pmatrix}\cos\alpha & -\sin\alpha & 0\\ \sin\alpha & \cos\alpha & 0\\ 0 & 0 & 1\end{pmatrix}$
    • translation : $T(t_x,t_y)=\begin{pmatrix}1 & 0 & t_x\\ 0 & 1 & t_y\\ 0 & 0 & 1\end{pmatrix}$
    • valid operation : if w -coord result 1 or 0
      • vector + vector : vector
      • point - point : vector
      • point + vector : point
      • point + point : ???
    • geometric interpretation : 2 hyperplanes in R 3
    • linear combinations of points
      • affine : i α i x i with i α i = 1
      • convex : i α i x i with i α i = 1 and α i 0
    • rotate around given point : T ( c ) R ( α ) T ( c )
  • object or camera transform

3D transformations

  • extended coordinates
    • 3D point : ( x , y , z , 1 ) T
    • 3D vector : ( x , y , z , 0 ) T
    • affine transformations : $\begin{pmatrix}x'\\ y'\\ z'\\ 1\end{pmatrix}=\begin{pmatrix}a & b & c & t_x\\ d & e & f & t_y\\ g & h & i & t_z\\ 0 & 0 & 0 & 1\end{pmatrix}\begin{pmatrix}x\\ y\\ z\\ 1\end{pmatrix}$
    • scale : $S(s_x,s_y,s_z)=\begin{pmatrix}s_x & 0 & 0 & 0\\ 0 & s_y & 0 & 0\\ 0 & 0 & s_z & 0\\ 0 & 0 & 0 & 1\end{pmatrix}$
    • translation : $T(t_x,t_y,t_z)=\begin{pmatrix}1 & 0 & 0 & t_x\\ 0 & 1 & 0 & t_y\\ 0 & 0 & 1 & t_z\\ 0 & 0 & 0 & 1\end{pmatrix}$
    • x -rotation : $R_x(\alpha)=\begin{pmatrix}1 & 0 & 0 & 0\\ 0 & \cos\alpha & -\sin\alpha & 0\\ 0 & \sin\alpha & \cos\alpha & 0\\ 0 & 0 & 0 & 1\end{pmatrix}$
    • y -rotation : $R_y(\alpha)=\begin{pmatrix}\cos\alpha & 0 & \sin\alpha & 0\\ 0 & 1 & 0 & 0\\ -\sin\alpha & 0 & \cos\alpha & 0\\ 0 & 0 & 0 & 1\end{pmatrix}$
    • z -rotation : $R_z(\alpha)=\begin{pmatrix}\cos\alpha & -\sin\alpha & 0 & 0\\ \sin\alpha & \cos\alpha & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1\end{pmatrix}$
    • rotation : R ( α , β , γ ) = R x ( α ) R y ( β ) R z ( γ ) , euler angles (roll, pitch, yaw)
    • gimbal lock : when one rotation "ring" aligned with another, lose a dimension
    • rotation by angle α around axis n : $R(n,\alpha)=\cos(\alpha)I+(1-\cos(\alpha))nn^T+\sin(\alpha)\begin{pmatrix}0 & n_z & -n_y\\ -n_y & 0 & n_x\\ n_y & -n_x & 0\end{pmatrix}$
    • quaternions : extension of complex number, encode orientation, good for interpolation, avoids gimbal lock

Viewing

  • vertex shader stage
  • object/model coordinates
  • word coordinates
  • eye coordinates
  • clip coordinates
  • window/screen coordinates : normalized device coordinates
  • look-at transformation : eye point e , up vector u , look-at point p
    • view direction : v = p e \norm p e
    • right vector r = v × u if u , v orthonormal
    • camera : ( e , r , u , v )
    • standard camera : located at origin, looking down negative z axis, up vector e 2
      • matrix : $\begin{pmatrix}r_x & u_x & -v_x & e_x\\ r_y & u_y & -v_y & e_y\\ r_z & u_z & -v_z & e_z\\ 0 & 0 & 0 & 1\end{pmatrix}$
      • inverse matrix : $\begin{pmatrix}r_x & u_x & -v_x & e_x\\ r_y & u_y & -v_y & e_y\\ r_z & u_z & -v_z & e_z\\ 0 & 0 & 0 & 1\end{pmatrix}^{-1}=\begin{pmatrix}r_x & r_y & r_z & 0\\ u_x & u_y & u_y & 0\\ -v_x & -v_y & -v_z & 0\\ 0 & 0 & 0 & 1\end{pmatrix}\begin{pmatrix}1 & 0 & 0 & -e_x\\ 0 & 1 & 0 & -e_y\\ 0 & 0 & 1 & -e_z\\ 0 & 0 & 0 & 1\end{pmatrix}$
  • projection
    • in mathematic : idempotent mapping P ( x ) = P ( P ( x ) )
    • in computer graphics : 3D spaces to planar 2D images, not invertible, depth information lost
  • planar geometric projections
    • parallel : one direction of projection for all points, preserve parallelism, technical application
    • orthographic : direction of projection perpendicular to image plan
    • perspective : vanishing point, each point projected towards center of projection, perspective foreshortening, realistic appearance, graphics application
      • standard projection
        • center of projection : ( 0 , 0 , 0 ) T
          • image plane : z = d
        • homogenous coordinates : $q=M\begin{pmatrix}x\\ y\\ z\\ 1\end{pmatrix}=\begin{pmatrix}x\\ y\\ z\\ z/d\end{pmatrix}\iff\begin{pmatrix}xd/z\\ yd/z\\ d\\ 1\end{pmatrix}$ with $p=\begin{pmatrix}wx\\ wy\\ wz\\ w\end{pmatrix}\iff\begin{pmatrix}x \\ y\\ y\\ z\\ 1\end{pmatrix}$ and $M=\begin{pmatrix}1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 1/d & 0\end{pmatrix}$
      • perpective fovy, aspect, near, far
        • t o p = n e a r t a n ( f o v y )
        • b o t t o m = t o p
        • r i g h t = t o p a s p e c t
        • l e f t = r i g h t
        • $M=\begin{pmatrix}\frac{2n}{r-l} & 0 & \frac{r+l}{r-l} & 0\\ 0 & \frac{2n}{t-b} & \frac{t+b}{t-b} & 0\\ 0 & 0 & -\frac{f+n}{f-n} & -\frac{2fn}{f-n} \\ 0 & 0 & -1 & 0 \end{pmatrix}$

Visibility

  • painter algorithm
    • sort : all polygons w.r.t. z m a x (farthest vertex)
    • disambiguate : if z m a x ( A ) > z m a x ( B ) > z m i n ( A )
      • [ x , y ] -ranges not overlapping : A
      • A behind supporting plane of B : A
      • B in front supporting plane of A : A
      • non-overlapping projections : A
      • B behind supporting plane of A : swap A & B
      • A in front supporting plane of B : swap A & B
      • repeated swap : cyclic overlap, split A at supporting plane of B
    • paint polygons from back to front
    • complexity : O ( n log n ) for n polygons
  • framebuffer : store RGB color values
  • z-buffer : store current min z -value for each pixel, 16-32 bits per pixel
    • per pixel z-value : interpolate with barycntric coordinates, GPU, incremental computation during rasterization, simple linear interpolation along scanlines
    • complexity : O ( n ) for n polygons, GPU hardware (sort)
// initialize depth buffer to infinity
for (each polygon P) {
	// scan conversion of polygon
	for (each pixel (x,y,z) in P) {
		if (z < zbuffer[x,y]) {
			framebuffer[x,y] = rgb;
			zbuffer[x,y] = z;
		}
	}
}
  • quantization : higher resolution at near plane
  • z-fighting
  • image space : multiple objects mapped into same pixel => z-buffer
  • object space : which part of object visible in given screne given viewpoint => painter algorithm, culling
  • culling : quickly reject objects (or parts) not visible from viewpoint, then solve complicated visibility for remaining
    • view frustumm culling : discard objects outside viewing frustum using bounding volumes or hierarchies against 6 clipping planes
    • backface culling : closed solid objects have front-facing triangles blocking black-facing ones, discards about half of them, f a c e n o r m a l v i e w v e c t o r > 0 , negative triangle area

Lighting and shading

  • physics approach : model global interaction of light in screen through photorealistic rendering, costly
    • rendering equation : L ( x , ω ) = L e ( x , ω ) + H 2 f r ( x , ω ω ) L ( x ( x , ω ) , ω ) cos θ d ω
  • light sources
    • illumination function : I ( x , y , z , θ , ϕ , γ )
    • total contribution at point : integrating over light source, complex
    • ambient light : constant intensity everywhere, uniformly brighten/darken a scene
    • point light : emits light equally in all directions, intensity drops with square distance, hard shadow
    • spot light : point light with limited angle, attenuation cos ê θ
    • directional light : commonly used for far away light sources (e.g. sun), faster to evaluate than point lights (no light vector to be recomputed)
    • area light
  • local illumination : combines ambient, diffuse, specular reflection
    • ambient light : coming from all directions, camera independant and surface orientation, reflected intensity, I a = k a L a
      • light source : L a
      • material parameter : k a s
    • diffuse reflection : I d = k d ( l n ) L d
    • specular reflection : I s = k s L s cos α ϕ = k s L s ( r v ) α
    • illumination : I = k a L a + k d ( n l ) L d + k s ( r v ) α L s
    • phong reflection :
    • piece-wise flat surface : per-vertex vs per-face normals
  • shading
    • flat : viewer far away (constant view vector), light far away (constant light vector), mach band effect
    • gouraud : per vertex, interpolate color across triangle
    • phong : interpolate normals normalized, apply reflection model per fragment
  • vertex normal : computing weighted averaging of incident triangle normals
  • normal transformation : do not forget to re-normalize
    • plane with normal : n
    • before affine transformation : ( n x , n y , n z , d ) ( x , y , z , 1 ) T = 0
    • after affine transformation : ( n x , n y , n z , d ) M ( x , y , z , 1 ) T = 0 ( n x , n y , n z , d ) T = ( M T ) 1 ( n x , n y , n z , d ) T

Texture

  • texture mapping : add details without raising geometric complexity
  • surface properties
    • reflectance : diffuse and specular coefficients
    • normal vector : normal mapping, bump mapping
    • geometry : displacement mapping
    • opacity
    • illumination : environment mapping
  • one triangle texture : assign ( u , v ) texture coordinate to each vertex and interpolate
    • linear interpolation in world coordinates : nonlinear interpolation in screen coordinates
    • perspective interpolation : GPU
  • texture filtering : ( u , v ) real pixel coordinates
    • round to nearest integer
    • bilinear interpolation in containing texel
  • texture aliasing
    • point sampling : depends on parameterization, texture minifaction leads to aliasing
    • anti-aliasing : integrate over image pixel area in texture space, approximated by ellispe (EWA filtering)
    • approximated by mip-mapping : store texture at multiple levels-of-detail, use smaller versions when far from camera
  • triangle mesh texturing :
    • texture coordinates parameterization : for each vertex from 2D texture domain to 3D object space
    • mapping from simple intermediate object to 3D mesh
    • spherical, cylindrical, planar maps
    • cube maps
    • spherical parameterization
    • properties : low distortion, bijective mapping, contrained map, finding cuts, texture atlases
  • OpenGL : per-vertex tecture coordinates interpolated by rasterizer, texture lookup done per fragment
  • special texture maps
    • light maps : precomputed lighting (from offline global illumination algorithm), often used for low-intensity
    • alpha maps : cut out geometrically complex shapes by removing transparent pixels
    • bump/displacement maps : adding surface detail whitout adding geometry (normals perturbation), bumps small compared to geometry

Procedural modeling

  • procedural texturing : can vary in all 3 dimensions (e.g. sinusoidal color)
  • procedural technics : algorithms, functions that generate computer graphics objects, abstraction, compact representation, infinite detai, parametric control, flexibility
  • noise functions : R n [ 1 , 1 ] , no obvious repetition, rotation invariant, band-limited, not scale-invariant, efficient to compute, reproductible
  • value noise
  • perlin noise : random gradient hermite-interpolated values
    • 2D perlin
    • parameters : amplitude, frequency
  • other noise : simplex noise (triangles/tetrahedrons), sparse gabor convolution
  • spectral analysis : representing complex function f s ( x ) by a sum of weighted contributions from a scaled function f ( x ) , f s ( x ) = i w i f ( s i x ) (e.g. Fourier)
  • fractional brownian motion : spectral synthesis of noise function, progressively smaller frequency/amplitude, each term in summation called octave
    • FBm : f s ( x ) = i l i H f ( l i x )
    • fractal increment : H ( 1 smooth, 0 more like white noise)
    • homogenous : same everywhere
    • isotropic : same in all direction
    • dimension :   2.1
double fBm(vector point, double H, double lacunarity, int octaves) {
	double value = 0.0;
	/* inner loop of fractal construction */
	for (int i = O; i < octaves; i++) {
		value += Noise(point) * pow(lacunarity, -H*i);
		point *= lacunarity;
	}
	return value;
}
  • turbulence : same as FBm, but sum absolute value of noise function
    • marble : c o l o r = s i n ( x + t u r b u l e n c e ( x , y , z ) )
    • wood : c o l o r = s i n ( x 2 + y 2 + F B m ( x , y , z ) )
  • multifractal
    • different fractal dimensions in different regions
    • scale higher frequencies in summation by value of previous frequency
    • heterogenous terrain
    • hybrid multifractal
    • ridged multifractal
    • multiplicative-cascade multifractal variation of FBm
double multifractal(vector point, double H, double lacunarity, int octaves, double offset) {
	double value = 1.0;
	for (int i = O; i < octaves; i++) {
		value *= (Noise(point) + offset) * pow(lacunarity, -H*i);
		point *= lacunarity;
	}
	return value;
}
  • erosion : wind, rain, rivers, complex but plausible results using simple ad hoc rules
  • logarithm spiral : x ( t ) = a e b t cos t , y ( t ) = a e b t sin t
  • fractals : repeition of given form over range of scales, self-similar, detail at multiple levels of magnification, fractal dimension exceeds topological dimension
  • richardson effect : how long is coast => infinite
  • integer euclidean dimension
    • take an object residing in Euclidean dimension D
    • reduce its linear size by 1 / r in each spatial direction
    • it takes N = r D self-similar objects to cover original objects
  • Hausdorff fractal dimension : D = log N log r
    • Cantor dust
  • fractal dimension
    • integer component : indicates underlying Euclidean dimensions
      • fractional part :fractal increment
  • Lindenmayer-systems : text substitution, G = ( V , ω , P )
    • character set : V , alphabet
    • axiom : ω , non-empty starting word
    • productions rules : P
    • graphical interpretation : turtle command
    • branching : special characters to store and restore state
    • stochastic : add probability
    • parametric : lenght parameterized
    • conditional : add conditions
    • 3D turtle state : position, rotation (pitch, yaw, roll), line length, difference angles
  • CGA : shape grammar language for procedural architecture
    • rule-driven modification and replacements of shapes
    • iteratively evolve design with more details
  • mass model
    • encoding architecture : design idea, classify its parts, define main parameters, encode design rules, add boundary conditions
    • parcel : general patterns and Zoning laws, max distances, footprint layout
    • facade subdivision : shape interaction need spatial overlap to align elements
    • roofs : hipped, flat
    • level of detail : texture vs geometry, multi-resolution

Shadow maps

  • depth perception
  • intuition about scene lighting
  • visibility : which objects can be seen from viewpoint
  • shadows : which objects can be seen from light source
  • shadow computation
  • dynamic shadows : multiple render passes
    • shadow volumes : polygonal representation of shadowed regions
      • serval overlapping shadow : entering intersection increment counter, leaving it decrement, can be done with stencil buffer
    • shadow maps : apply visibility techniques for shadows, render scene as seen from light source and project, light z-buffer called shadow map for each light source
      • shadow acne : intensity/depth bias
      • percentage closer filtering : sample in pixel vicinity, sample position around P with poisson disk sampling
      • resolution : squared shadowed if low resolution, light frustum must contain all objects that could cast shadows into camera frustum
      • cascaded : combination, higher resolution closer to camera, state of the art use 4 cascades

Reflections

  • environment maps : approximate method to render reflective objects assuming incoming light only depends on direction, no self-reflection
    • basic algorithm : for each pixel, compute normal vector at surface point, reflected view vector at surface point, index into environment map
    • sphere maps : ( u , v ) texture coordinates
    • cube maps : simplify synthetic generation, 6 faces

Raytracing rasterization

  • light transport : straight lines, rays do not interfere with each other if crossing, travel from light sources to eye
  • raytracing
    • geometrical optics : no diffraction, no polarization, no interference
    • discrete wavelength : approximation of color, quanized dispersion and fluorescence
    • superposition : no non-linear reflecting materials
    • forward
    • backward
  • ray casting : generate an image by sending one ray per pixel, check for shadows by sending ray towards the light
  • pipeline
rayTraceImage() {
	parse scene description
	for each pixel
		generate primary ray
		pixel color = trace(primary ray)
}
trace(ray) {
	hit = find first intersection with scene objects
	color = lighting(hit) // might trace more rays (recursive)
	return color
}
  • rays : parametric form r ( t ) = o + t d with o origin and d direction
  • intersection
    • sphere : ( x c ) 2 r 2 = 0 , insert x = r ( t ) and solve for t
    • plane : ( x p ) n = 0 , same
    • triangle : ( o + t d p 1 ) n = 0 with triange normal n = ( p 2 p 1 ) × ( p 3 p 1 ) , test whether hit-point within using barycentric
  • lighting
  • shadows : send a ray from intersection point to light source, only ambient light if intersected by another object
    • floating point error : intersection tolerance ϵ needed
  • recursive raytracing
    • reflection : same incident and reflected angle
    • refraction : Snell law n 1 sin θ 2 = n 2 sin θ 2
  • depth of field
  • motion blur
  • caustics
  • global illumination
  • rasterization
  • ray tracing acceleration
    • brute force : intersect every ray with every primitive O ( I N )
    • spatial datastructure : sorting, uniform grids, adaptive grids, bsp-trees
      • kd-trees : recusively split cell using axis-aligned plane until maximum depth of minimum number of remaining objects reached, top-down
      • bounding volume hierarchies : divide and conquer O ( log N ) , group objects and bound by simple volumes for fast intersection rejection, bottom-up
        • sphere
        • axis-aligned bounding box : AABB
        • oriented bounding box : OBB
        • k-discrete orientation polytopes : k-DOPs
        • convex hulls

Bezier

  • smooth curves : camera paths, animation curves, fonts, blending, scattered data approximation
  • parametrics curves : simple, injective (no self-intersections), differentiable, regular (no null speed)
  • curve length : t i = a + i Δ t and x i = x ( t i )
    • chord length : S = i \norm Δ x i = i \norm Δ x i Δ t Δ t with euclidean norm and Δ x i = x i + 1 x i
    • arc length : s = s ( t ) = a t \norm x ˙ d t
  • bezier curvees
    • properties : affine invariance, invariance under affine parameter transformations, convex hull property, endpoint interpolation, symmetry, linear precision, variation diminishing
    • derivative : d d t b n ( t ) = i = 0 n b i d d t B i n ( t ) = n i = 0 n 1 Δ b i B i n 1 ( t ) with forward differencing operation Δ b i = b i + 1 b i
    • uniform speed : unit speed parameter interval does not mean unit speed on curve
    • increasing control points : raises degree of curve
  • Bernstein polynomials : B i n ( t ) = ( n i ) t i ( 1 t ) n i
    • recursion : B i n ( t ) = ( 1 t ) B i n 1 ( t ) + t B i 1 n 1 ( t ) with B 0 0 ( t ) = 1 and B j n ( t ) = 0 for j 0 , , n
    • partition of unity : j = 0 n B j n ( t ) = 1 , global support, positive
    • derivative : d d t B i n ( t ) = n ( B i 1 n 1 ( t ) B i n 1 ( t ) )
    • bezier cruve form : b n ( t ) = b 0 n ( t ) = j = 0 n b j B j n ( t )
      • bezier/control point : b j , define control polygon
  • piecewise bezier : global parameter u
    • segment boundaries : knots u 0 < < u L define intervals [ u i , u i + 1 ]
    • local parameter t in each interval : t = u u i u i + 1 u i = u u i Δ i
    • curvate derivatives : d d u s ( u ) = d d t s i ( t ) d t d u = 1 Δ i d d t s i ( t )
    • decomposition : in [ u 0 , u 2 ] , two bezier segments b 0 , , b n in [ u 0 , u 1 ] and b n , , b 2 n in [ u 1 , u 2 ]
    • enforce C r -continuity at boundaries : b n + i = b n i i ( t ) for i = 0 , , r
    • first segment : deCasteljau algorithm