CSC214 Computer Graphics

Computer GraphicsUnit 46 min read

Curve & Surface Representation: Parametric, Bezier, B-Spline, Polygons & Fractals

Unit 4 of Computer Graphics covers parametric curve representations (Bezier, B-spline), surface modeling (polygon meshes, fractals), and mathematical foundations for smooth curves and complex shapes, with practical algorithms and exam-focused comparisons.

Core Concepts

1. Parametric Curves

Parametric curves define shapes using a parameter (often ) to map to coordinates . They are fundamental for smooth, scalable graphics.

Key Properties

  • Continuity: (connected), (tangent continuity), (curvature continuity).
  • Degree: Number of control points minus one (e.g., cubic Bezier has degree 3).
  • Convex Hull Property: The curve lies within the convex hull of its control points.

Example: Linear Interpolation

For points and , the parametric form is:


2. Bezier Curves

Bezier curves are piecewise parametric curves defined by control points . They are widely used in CAD/CAM (e.g., Adobe Illustrator, AutoCAD).

Mathematical Definition

For control points, the Bezier curve is:

  • Bernstein Polynomials: ensure smooth interpolation.
  • De Casteljau’s Algorithm: A recursive method to compute points on the curve (useful for rendering).

Worked Example: Cubic Bezier Curve

Given control points , , , , compute :

  1. Step 1: Compute intermediate points:
  2. Step 2: Compute next level:
  3. Step 3: Final point:

Plot Sketch:

P0(0,0) ---- P1(1,2)
           /    \
          /      \
P2(3,3) ---- P3(4,0)

The curve starts at , ends at , and is "pulled" toward and .

Advantages/Disadvantages

Pros Cons
Simple to compute and render Limited local control (moving one point affects entire curve)
Intuitive control points Higher degrees can cause oscillations
Affine invariance (scaling/rotation preserves shape) Not ideal for complex shapes (e.g., circles require 4 points)

3. B-Spline Curves

B-splines (Basis Splines) generalize Bezier curves with:

  • Knot vectors: Define parameter ranges for segments.
  • Local control: Adjusting one control point affects only a subset of the curve.
  • Degree : Typically cubic () for smoothness.

Mathematical Definition

For a knot vector and control points , the B-spline curve is: where are B-spline basis functions.

Comparison: Bezier vs. B-Spline

Feature Bezier Curve B-Spline Curve
Control Global (all points affect entire curve) Local (adjust one point, limited impact)
Knots Fixed (0 to 1) Customizable (knot vector)
Degree Fixed per curve Uniform or non-uniform
Shape Always passes through and Can be open or closed
Example Use Font design, simple shapes CAD/CAM, animation, complex models

Worked Example: Quadratic B-Spline

Given control points , , and knot vector , compute :

  • Basis functions , , .
  • .

4. Surface Representation

A. Polygon Meshes

  • Polygon Table: Stores vertices, edges, and faces (e.g., triangles, quadrilaterals).
    • Vertex List: coordinates.
    • Face List: Indices referencing vertices (e.g., Face 1: 0,1,2 for vertices ).
  • Applications: 3D modeling (e.g., Blender, Maya), game engines.

B. Parametric Surfaces

Extend curves to 2D using two parameters and :

  • Bezier Surface: Tensor product of Bezier curves.
  • B-Spline Surface: Tensor product of B-splines.

C. Fractals

  • Definition: Self-similar structures generated iteratively (e.g., Mandelbrot set, Koch snowflake).
  • Properties:
    • Recursion: Simple rules applied repeatedly.
    • Infinite Detail: Zooming reveals new patterns.
  • Applications: Procedural generation, terrain modeling, artistic designs.

Mermaid Diagram: Fractal Construction

flowchart TD
    A["Start with\nInitial Shape"] --> B["Apply\nTransformation"]
    B --> C["Check\nTermination?"]
    C -->|No| D["Add to\nComposite"]
    D --> B
    C -->|Yes| E["Render\nFractal"]

5. Curve and Surface Interpolation

  • Interpolation: Curve passes through all control points (e.g., Lagrange polynomials).
  • Approximation: Curve fits control points but doesn’t pass through them (e.g., least-squares fitting).
  • Example: Catmull-Rom splines (interpolating B-splines).

Exam Tip

  1. Bezier Curves:

    • Memorize the De Casteljau algorithm for computation.
    • Plot rough sketches for control points (e.g., "humps" for and ).
    • Common Pitfall: Forgetting the curve only passes through and .
  2. B-Splines:

    • Compare with Bezier curves in terms of local control and knot vectors.
    • Know the degree affects smoothness (higher degree = smoother but computationally expensive).
  3. Surface Representation:

    • Explain polygon meshes using vertex/face tables.
    • For fractals, describe self-similarity and recursive generation.
  4. Numerical Questions:

    • Always show step-by-step calculations (e.g., De Casteljau).
    • For , compute intermediate points explicitly.
  5. Diagrams:

    • Draw control polygons for Bezier/B-spline curves.
    • Label axes and key points (e.g., , curve direction).

Bezier curve control pointsExample of a cubic Bezier curve with 4 control points (Image: 丁志仁, CC BY-SA 4.0, via Wikimedia Commons)

Based on the TU BSc CSIT syllabus for Computer Graphics (CSC214), unit 4.

Discussion

Loading…