380 likes | 988 Views
Graphics II 91.547 Introduction to Parametric Curves and Surfaces. Session 2. Computer Graphics Conceptual Model. API. Output Devices. Application Program. Application Model. Graphics System. Input Devices. Function Calls or Protocol. Data.
E N D
Graphics II 91.547Introduction to Parametric Curvesand Surfaces Session 2
Computer GraphicsConceptual Model API Output Devices Application Program Application Model Graphics System Input Devices Function Calls or Protocol Data
Independent Variable Dependent Variable Explict Representation of Curve:Two Dimensions General case: Neither variable is a single-valued function of the other. Example: a circle centered at the origin
Explicit Representation of a Curve:Three Dimensions y x c z Plane x = c
Implicit Representation Two Dimensions: Describes a curve Should be thought of as a “membership” or “testing” function. Divides space into points on the curve and not on the curve. Line: Circle:
Implicit Representation:Three Dimensions Defines a surface in three dimensions. Example: a sphere of radius r at origin There is no easy way to represent a curve implicitly in three dimensions. Algebraic surfaces are those in which f is polynomial in x, y, z. Quadric surfaces are algebraic surfaces where the polynomial is of degree at most 2.
Problems with Implicit Representation • Difficult to evaluate for rendering because identifying points on the curve requires explicit solution for (x,y). • Limited variety of curves that can be obtained.
Parametric Representationof Curves and Surfaces Express each spatial variable for points on the curve as a function of a non-spatial independent variable. Where u is defined over some closed range, e.g. [0, 1] Parametric surfaces require two parameters:
Advantages of Parametric Representation • Solves problem of choice of independent variable • Easy computation of derivatives • Provides mechanism for “tracing” a curve or surface • Facilitates joining of multiple curves, surfaces • Generates a rich variety of curves, surfaces • Ease of rendering
Parametric Polynomial Curves Defines points on a parametric curve. A polynomial parametric curve of degree n is defined:
Parametric Polynomial Surfaces y u=1 v=0 v=1 x u=0 z
Continuity Considerations C0continuity: = C1continuity: G1continuity:
What degree do we want? High order polynomials provide more control over shape of curve. Degree n provides 3(n+1) degrees of freedom, in the choice of ck. The higher the order of a polynomial, the less “smooth” it is. A polynomial of degre n can change directions n-1 times. Consider polynomial of order 5.
Interpolation:Four control points on curve This constraint can be expressed by the equations:
Computing the coefficients Expressing the constraints in matrix form: Where:
Blending Functions Substituting from gives: which can be written as: where is a column vector of blending functions.
Expressing a point on the curve in terms of theblending polynomials Control points @
Let’s look at polynomials as a vector space. • Contains scalars and polynomials (vectors) • Addition, zero polynomial defined • Can express a basis, e.g. • Representation of a polynomial in terms of this basis can be expressed as a column vector of scalar coefficients.
Representation: Basis: Conversion of representation fromone basis to another
Representation: Basis: Conversion of representation fromone basis to another The central issue in parametric curves (and surfaces) is the selection of an appropriate basis for the control point representation.
u = constant v = constant How do we extend this to 3 dimensions? Interpolating Patch
Bicubic interpolating surface patch 16 coefficients allow the interpolation of 16 points.
Solving for Coefficients Substituting the values at 16 points: Gives the equation: Where asbefore
Solving for Coefficients Note: separability of blending polynomial in u, v.
u = constant v = constant Lines of constant u and v areInterpolating curves