+ All Categories
Home > Documents > ComputerGraphics 1

ComputerGraphics 1

Date post: 06-Mar-2016
Category:
Upload: rajyalakshmi-jammalamadaka
View: 217 times
Download: 0 times
Share this document with a friend
Description:
Material for splines

of 28

Transcript
  • Computer Graphics

    Spring 2007, #8B-splines, fractals

  • Contents B-splines Fractals

  • Bzier splines Bzier splines

    Approximative splines Defined for n+1 control points Pass though the first and last control point A change in one control point affects the full curve Slightly cumbersome to concatenate

    Ideal case? Approximative splines with local dependency on

    control points We may specify the full set of points at once instead

    of concatenating

  • B-Spline Family B-splines are defined using a blending

    function formalism for specific values of u. Given:

    n+1 control points {pk}, k = 0,1 ... n polynomial degree d knot vector: {... , uk, uk+1, ...}

    Blending functions Bk,d(u):P(u) = k=0,n pkBk,d(u) umin u umax

    2 d n+1

  • B-Spline Family Bk,d(u) is a polynomial of degree d-1 in u The blending functions are defined over a

    subinterval of u, given by the knot vector Recursion formulae (Cox-deBoor)

    Bk,d(u) = (u-uk)/(uk+d-1-uk)Bk,d-1(u) + (uk+d-u)/(uk+d-uk+1)Bk+1,d-1(u)

    Bk,1(u) = 1 if uk u uk+1, otherwise 0

  • B-Spline Family Properties for B-splines:

    B-splines are degree d-1 polynomials and Cd-2(higher order discontinuities at uk)

    For n+1 control points we have n+1 blending functions

    Each blending function Bk,d(u) is defined over d subintervals in the knot vector, starting at uk

    The knot vector has n+d+1 values, with n+d subintervals

  • B-Spline Family Properties for B-splines

    With the labelling {u0, u1, ... , un+d} for the knot vector, the resulting B-spline is defined only for u [ud-1,un+1].

    Each section of the B-spline curve between [uj,uj+1] is influenced by d control points.

    Any control point affects the shape of (at most) d curve sections

    for u [ud-1,un+1] we have: k=0,n Bk,d(u) = 1

  • Uniform B-Splines Definition: A uniformly defined knot vector

    defines a uniform, periodic B-spline A uniform knot vector has evenly spaced values Ex: {-1.0, -0.5, 0.0, 0.5, 1.0, 1.5} Normalized knot vector uk = (uk+1.0)/2.5

    {0.0, 0.2, 0.4, 0.6, 0.8, 1.0} Another normalization:

    {0,1,2,3,4,5,6}

  • Uniform, Quadratic B-Splines Uniform: the knot vector is uniform Quadratic: d -1 = 2, that is, d = 3 Suppose we have n = 3 We now obtain the following results:

    knot vector has n+d+1 = 7 values we choose {0,1,2,3,4,5,6} u ranges from 0 to 6, but u[ud-1,un+1] = [u2,u4]

    for the spline curve

  • Uniform, Quadratic B-Splines Using Cox-deBoor recursion formulae

    obtain B0,3(u), B1,3(u), B2,3(u), B3,3(u) The curve starts at u = 2: P(2) = (p0+p1)/2 The curve ends at u = 4: P(4) = (p2+p3)/2 The derivative at u=2: P(2) = p1-p0 The derivative at u=4: P(4) = p3-p2

  • B-splines, -Splines A non-uniform knot vector defines a non-

    uniform B-spline: {0,0.5,1,2,2.5,3} for d=2, n=3

    A non-uniform knot vector with the end-values repeated defines an open B-spline: {0,0,1,2,3,3} for d=2, n=3.

    -splines have geometric continuity at knot points uk

  • Rational Splines, NURBS Rational splines are ratios of two weighted

    polynomials, e.g. a rational B-splineP(u) = k=0,n kpkBk,d(u) / k=0,nkBk,d(u)

    For rational splines with non-uniform B-splines we have NURBs (non-uniform rational splines) NURBS can represent conic curves exactly

    (circles, parabola, hyperbolas) NURBs are invariant under perpective

    transformations

  • Splines: Evaluation We try to evaluate e.g.

    x(u) = au3+bu2+cu+d Horners rule: x(u) = ((au+b)u+c)+d Another trick: scan u with fixed :

    uk+1=uk+Given x(u) = u+ and xk = x(uk) = uk+Then xk+1=x(uk+) = (uk+)+ = xk+Hence xk+1 = xk +xk where xk =

  • Splines: Evaluation Scanning second order curves:

    Given x(u) = au2+bu+c and uk+1= uk+xk = x(uk) = auk2+buk+cxk+1 = x(uk+1) = a(uk+)2+b(uk+)+c

    = xk + 2uk + 2 + = xk +xkxk+1 = xk + 2xk = 2(uk+) + 2 +

    = xk + 22 = xk + 2xk

  • Splines: Evaluation Final algorithm:

    Calculate: x0 = au02+bu0+cx0 = 2u0 + 2 + 2x0 = 22

    Iterate: 2xk+1 = 2xkxk+1 = xk + 2xkxk+1 = xk +xk

  • Fractal Curves In many applications the detail that can be

    seen is a function of distance: consider looking at a skyline of mountains ...

    After zooming in for a while things start looking flat

    Basic idea: Generate fake detail when needed!

    This detail is of course not true, but may be belivable ...

  • Fractal Curves Types of fractals

    Self-similar: parts are scaled down versions of the full object

  • Fractal Curves Self-affine: parts are scaled down versions with

    different sx,sy,sz:

  • Fractal curves Fractal sets: points are classfied according

    to their behaviour under non-linear transformations

  • Fractal Dimension Measure for the detail of a fractal object. More jaggedness implies a higher fractal

    dimension. Typically non-integer! Straightforward to calculate for self-similar

    objects.

  • Fractal Dimension Idea: Subdivide an object by factor s

    whereby n scaled down objects are produced.

    Definiton of fractal dimension d:nsd = 1ln(n) + dln(s) = 0 d = -ln(n)/ln(s) = ln(n)/ln(1/s)

  • Fractal Dimensions Examples:

    s = , n = 2, d = ln(2)/ln(2) = 1

    s = , n = 4, d = ln(4)/ln(2) = 2

  • Fractal Dimensions Koch curve:

    Initiator generator

    s = 1/3, n = 4, d = ln(4)/ln(3) 1.2619Total length of curve: 3(4/3)k

    1/3 1/3

    1/3 1/3

    1

  • Fractal Dimensions

    s = , n = 8, d = ln(23)/ln(22) = 3/2

    s = 1/3 , n = 2, d = ln(2)/ln(3) 0.63

  • Fractal Dimensions

    s = 1/8, n = 16, d = ln(2*8)/ln(8) = 1+ln(2)/ln(8) = 1 + 1/3 = 4/3

  • Transformation function fractals Basic idea

    Represent a 2D world (x,y) by the complex number z = x+iy

    Take a (nonlinear) transformation function f(z) Start from z0, generate z1=f(z0), z2 = f(z1)

    Depending on z0 and f(z), the sequence zn diverges (attractor at infinity) converges to a point (attractor) degenerates to a 1D or 0D world

  • Transformation function fractals Example of degenerate worlds

    (universality classes): goes round in a circle jumps between a set of points

    Sample case: f(z) = z2|z| < 1

    |z| = 1

    |z| > 1

  • Transformation function fractals Generate nice pictures by colouring points

    according to their asymptotic behaviour (how many iterations it takes to reach a finite limit)

    Julia set = boundary between converging and diverging points. if f(z) tends away from the Julia set, f-1(z)

    tends towards it!


Recommended