CS代考 CM0304 Graphics I Graphics Hardware I.1 Graphics Systems

CM0304 Graphics I Graphics Hardware I.1 Graphics Systems

CMT107 Visual Computing

Copyright By PowCoder代写 加微信 powcoder

VII.1 Curves

Xianfang Sun

School of Computer Science & Informatics
Cardiff University

➢Curve representations

• Explicit representation

• Implicit representation

➢Parametric representation of curves

• Piecewise polynomial curves (spline curves)

• Bézier curves

15:21 2CMT107 Visual Computing

15:21 3CMT107 Visual Computing

➢A curve is a set of positions of a point moving with one

degree of freedom

➢Useful to describe shapes on a higher level

• Not only straight lines or curved shapes approximated by

short line segments

• Simpler to create, edit and analyse

• More accurate rendering and less storage

(compared to linear approximation)

Explicit Representation

15:21 4CMT107 Visual Computing

➢ Explicit curve: y = f(x)

• Essentially a function plot over some interval x  [a, b]

➢ Properties:

• Simple to compute points and plot them

• Simple to check whether a point lies on curve

• Cannot represent closed or multi-valued curves:

Only one y value for each x value (a function)

Implicit Representation

15:21 5CMT107 Visual Computing

➢ Define curves implicitly as solution of an equation system
• Straight line in 2D: Ax + By + C = 0
• Circle of radius R in 2D: x2 + y2 – R2 = 0
• Conic section: Ax2 + 2Bxy + Cy2 + Dx + Ey + F = 0
• Matrix/vector representation up to order two:

xTMx + vTx + s = 0 (x = [x y]T)
➢ In 3D, two equations are needed

(1 equation restricts 1 variable, but there are 3 variables)
• Straight line: Ax + By + Cz + D = 0,

Ex + Fy + Gz + H = 0
• A circle in x-y plane: x2 + y2 = r2,

Properties of Implicit Curves

15:21 7CMT107 Visual Computing

➢ Mainly use polynomial or rational functions
➢ Coefficients determine geometric properties
➢ Properties:

• Hard to render (have to solve non-linear equation system)
• Simple to check whether a point lies on curve
• Can represent closed or multi-valued curves

Parametric Curves

15:21 8CMT107 Visual Computing

➢ Describe the position on the curve by a parameter u  R

• x(u), y(u), z(u) are usually polynomial or rational
functions in u

• u  [a, b], usually u  [0, 1]
➢ Parameter function maps parameter to model coordinates

• Parameter space: u (parameter domain)
• Model space: x, y, z (Cartesian coordinates)

Properties of Parametric Curves

15:21 9CMT107 Visual Computing

➢ Properties:
• Simple to render (evaluate parameter function)
• Hard to check whether a point lies on curve

(must compute inverse mapping from (x, y, z) to u;
involves solving non-linear equations)

• Can represent closed or multi-valued curves

➢ Describe coordinates by polynomials:

➢ Smooth (infinitely differentiable)
➢ Higher order curves (say > 4) cause numerical problems
➢ Hard to control shape by interpolation

Parametric Polynomial Curves

15:21 10CMT107 Visual Computing

➢ Bernstein basis polynomials

• is binomial coefficient.

• Property:

➢ A Bernstein polynomial is a linear combination of
Bernstain basis polynomials

15:21 11CMT107 Visual Computing

( ) .,,1,0,1)( dluu

( ) ].1,0[,)(

( ) ]1,0[for 1

➢ There are 4 cubic Bernstein basis polynomials

Cubic Bernstein Basis Polynomials

15:21 12CMT107 Visual Computing

➢ Cut curve into segments and represent each segment as
polynomial curve

➢ Can use low-order polynomial curves, e.g. cubic (order 3)
➢ But how to guarantee smoothness at the joints?

Continuity problem

Piecewise Polynomial Curves

15:21 13CMT107 Visual Computing

➢ In general, piecewise polynomial curves are called splines
• Motivated by loftsman’s spline

• Long narrow strip of wood or plastic
• Shaped by lead weights (called ducks)

• Gives curves that are smooth or fair

Spline Curves

15:21 14CMT107 Visual Computing

➢ Represent a polynomial segment as

• Control points pl  R

determine segment’s shape

• : lth Bernstain basis polynomial of degree d.

➢ Cubic Bézier curve (d = 3) has four control points

• Note that

Convex combination of control points

Bézier Curves

15:21 15CMT107 Visual Computing

( )  1,0,)(

( ) ]1,0[for 1

( )  .1,0,1)(

➢ Convex hull:
• curve lies inside the convex hull of its control points

➢ Endpoint interpolation:

➢ Tangents
Q’(0) = d(p1 – p0)
Q’(1) = d(pd – pd-1)

➢ Symmetry
• Q(u) defined by p0, … , pd is equal

to Q(1 – u) defined by pd, … , p0

Properties of Bézier Curves

15:21 16CMT107 Visual Computing

➢ Smooth joint between two Bézier curves of order d with

control points {p0, … , pd}, {p’0, … , p’d} respectively
• C0: same end-control-points at joints: pd = p’0

(due to end-point interpolation)
• C1: control points pd-1, pd = p’0, p’1 must be collinear

(due to tangent property)

Continuity conditions create restrictions on control points

Smooth Bézier Curves

15:21 17CMT107 Visual Computing

➢ Parametric continuity:
• C0: curves are joined
• C1: first derivatives are equal at the joint points
• C2: first and second derivatives are equal

• Cn: first through nth derivatives are equal

➢ Geometric continuity:
• G0: The curves touch at the joint points
• G1: The curves also share a common tangent direction

at the joint points (first derivatives are proportional )
• G2: The curves also share a common centre of curvature

at the joint points (first and second derivatives are
proportional )

Parametric/Geometric Continuity

15:21 18CMT107 Visual Computing

➢ Curve should be smooth to some order at joints
➢ Different types of continuity at joints
➢ Geometric continuity: from the geometric viewpoint
➢ Parametric continuity: for parametric curves

➢ Parametric continuity of order n implies geometric
continuity of order n, but not vice versa.

Smoothness / Continuity

15:21 19CMT107 Visual Computing

15:21 20CMT107 Visual Computing

➢ What is the implicit and explicit representation of a
curve? What are the advantages and disadvantages
of these representations?

➢ What are piecewise parametric polynomial curves
(splines)? What is the advantage of this representation?
What is the main problem?

➢ What are Bézier Curves and how are they defined? What
properties do they have?

➢ What is the major problem when using piecewise
polynomial curves? What conditions do the control points

of a Bézier Curve have to fulfil in order to get C0/C1
continuous curves?

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com