Parametric Representations Lecture Notes

Parametric Representations: Motivation

  • Transformations and rendering processes can be simplified using parametric representations.
  • Parametric representations can handle complex objects more easily.

Lecture Overview

  • Topics:
    • Parametric representation
    • Curves
    • Surfaces
    • Drawing curves

Curves as Functions

  • Curves can be represented using functions where changing xx affects yy.
  • Examples: f(x)=x2f(x) = x^2, f(x)=cos(x)f(x) = cos(x)
  • Characteristics: For every xx, there is only one corresponding yy. Thus, there are no overlaps.
  • Problem: A single xx value cannot represent multiple yy values.

Parametric Representation of Curves

  • Solution: Use a parameter tt to represent both xx and yy.
    • x=x(t)x = x(t)
    • y=y(t)y = y(t)
  • tt represents the distance along the curve.
    • t=0t = 0: start of the curve.
    • t=0.5t = 0.5: halfway point of the curve (assuming total length is 1).
    • t=1t = 1: end of the curve.

Parametric Representation of Surfaces

  • Curves are 2D (x, y), while surfaces are 3D.
  • Use two parameters, uu and vv, to represent a surface.
    • x=x(u,v)x = x(u, v)
    • y=y(u,v)y = y(u, v)
    • z=z(u,v)z = z(u, v)

Parametric Equation of a Line

  • Representing a line using two points (x<em>A,y</em>A)(x<em>A, y</em>A) and (x<em>B,y</em>B)(x<em>B, y</em>B).
  • Standard equation: y=mx+cy = mx + c
  • Parametric representation using tt:
    • x=x<em>A+(x</em>BxA)tx = x<em>A + (x</em>B - x_A)t
    • y=y<em>A+(y</em>ByA)ty = y<em>A + (y</em>B - y_A)t
  • x<em>Bx</em>Ax<em>B - x</em>A represents the total horizontal displacement.
  • y<em>By</em>Ay<em>B - y</em>A represents the total vertical displacement.
  • tt represents the fraction of the total displacement.
  • When t=0t = 0, x=x<em>Ax = x<em>A and y=y</em>Ay = y</em>A.
  • When t=1t = 1, x=x<em>Bx = x<em>B and y=y</em>By = y</em>B.

Example: Finding Parametric Equation

  • Given points (1,4)(1, 4) and (5,8)(5, -8), find the parametric equations.
    • x=1+(51)t=1+4tx = 1 + (5 - 1)t = 1 + 4t
    • y=4+(84)t=412ty = 4 + (-8 - 4)t = 4 - 12t
  • If y=0y = 0, find the value of xx.
    • 0=412tt=412=130 = 4 - 12t \,\Rightarrow\, t = \frac{4}{12} = \frac{1}{3}
    • x=1+4(13)=1+43=73x = 1 + 4(\frac{1}{3}) = 1 + \frac{4}{3} = \frac{7}{3}

Parametric Representation of a Circle

  • Equation: x2+y2=r2x^2 + y^2 = r^2
  • Parametric representation: Using tt to represent the angle, where tt represents the percentage of the total 360 degrees.
    • x=rcos(θ)x = r \cdot cos(\theta)
    • y=rsin(θ)y = r \cdot sin(\theta)

Summary of Parametric Representations

  • Single function: f(x)f(x)
  • Parametric curve: Using tt to represent xx, yy, and zz.
  • Surface: Using uu and vv to represent xx, yy, and zz.
  • tt represents distance along the curve.
  • uu and vv represent location on the surface.
  • Linear, cubic, or arithmetic functions can be used to represent different shapes.

Bezier Curves

  • The shape of the curve is controlled by control vertex points.
  • The curve usually lies within the convex hull of the control points.
  • The Bezier curve is typically cubic but can be of higher order.
  • Function: A Bezier curve is represented as the sum of basis functions.
    • P=B<em>i(t)P</em>iP = \sum B<em>i(t) P</em>i
      • Where P<em>iP<em>i represents control points and B</em>i(t)B</em>i(t) represents basic functions.
  • The basic function is similar to x(t)x(t) and gives a weight to each control point.
  • The location of points on the curve depends on the weights of the control points.
  • The sum of the weights equals one.

Characteristics of Bezier Curves

  • Different control points yield different shapes.
  • Basic functions are global, meaning every control point impacts the overall shape of the curve.
  • Every control point contributes to the overall shape.
  • Curves lie inside the convex hull, ensured by the fact that the sum of basic functions equals one, and each basic function is greater than zero.
  • Complex curves can be constructed by combining multiple segments.

Smoothly Connecting Bezier Curve Segments

  • Multiple segments can be joined using different control points.
  • Smoothness is achieved by ensuring collinearity at the joint control point.
  • Types of continuity:
    • Zero order: The two segments have a joint control point.
    • First order: The segments not only have a joint control point, but the tangents are equal.
    • Second order: The second derivative is equal at the joint point.
  • Geometric continuity requires derivative continuity.

Bezier Surfaces

  • Surfaces are 3D, while curves are 2D.
  • Surfaces are controlled by parameters uu and vv.
  • Every point on the surface is defined by uu and vv.
  • Functions involve control points and Bernstein polynomials.
  • Surface lies within the convex hull of all control points.
  • Transforming a control point significantly impacts the shape of the surface.
  • When uu and vv are constant, it results in Bezier curves.
  • Bezier surface can be regarded as several Bezier curves.

Characteristics of Bezier Surfaces

  • Increasing control points increases complexity.
  • Control is non-local, meaning a single control point can impact the entire surface.
  • Surfaces are often constructed from bicubic patches.
  • Similar to curves, derivative continuity allows combination of surfaces.

Drawing Curves

  • Involves interpolation between control points.
  • Given four control points (P<em>0,P</em>1,P<em>2,P</em>3)(P<em>0, P</em>1, P<em>2, P</em>3), the first layer of interpolation results in (Q<em>0,Q</em>1,Q<em>2)(Q<em>0, Q</em>1, Q<em>2). The second layer results in (R</em>0,R1)(R</em>0, R_1), and the final interpolation yields point B on the curve.

Formats for Curve Drawing

  • Approximating: Passes through only the starting point but not necessarily through all control points.
  • Interpolating: Goes through all control points.
  • Cubic splines have continuous first or second derivatives at joint control points.

NURBS (Non-Uniform Rational B-Splines)

  • Basic functions are local, meaning changing a single control point only impacts a local part of the curve.
  • Offers finer control compared to Bezier surfaces or curves.

NURBS for Surface Definition

  • Allows defining the shape of a surface using control points and basic functions.
  • Adjusts overall and local shapes.
  • Complex curves result in complex 3D meshes.
  • Subdivision algorithms have started to replace this generation method.