Computer Graphics Unit VI: Curves And Fractals
Introduction Two approaches to generate curved line 1. Curve generation algorithm Ex. DDA Arc generation algorithm 2. Approximate curve by number of straight line Ex. Interpolation method DYPCOE, Akurdi, 3/31/2017 2
DDA Arc Generation Algorithm[1] 3
Interpolation Curves can be drawn with approximation method If we have some sample points which lie on required curve then we can draw curve by filling the portion by known curve ie line The gap between the sample points can be filled by finding the coordinates of the points along the curve DYPCOE, Akurdi, 3/31/2017 4
Interpolation Unknown Curve Known Sample Points DYPCOE, Akurdi, 3/31/2017 5
Interpolation Suitable mathematical equations are used to approximate the curve Polynomial functions in parametric form is used X=f x (u) Y=f y (u) Z=f z (u) Polynomial curve is passing through n sample points (x1,y1,z1).(xn,yn,zn) DYPCOE, Akurdi, 3/31/2017 6
Interpolation The function can be given as f x (u)= sum from i = 1 to n of x[i] B[i](u) f y (u)= sum from i = 1 to n of y[i] B[i](u) f z (u)= sum from i = 1 to n of z[i] B[i](u) Where B[i](u) is blending function, for each value of u, it determines how much the ith sample points affects position of the curve. For some value of u, if B[[i](u) =1, then ith sample point has complete control of the curve ie, curve will pass through that point. DYPCOE, Akurdi, 3/31/2017 7
Interpolation LeGRANGE INTERPOLATED CURVES U= -1, 0, 1. If u= -1, B 1 (u) = 1 and 0 for u=0, 1, 2..n-2 If u= 0, B 2 (u) = 1 and 0 for u= -1, 1, 2..n-2 Lagrange Interpolation Expression is given as DYPCOE, Akurdi, 3/31/2017 8
Interpolation Blending functions for four sample points are give as per below DYPCOE, Akurdi, 3/31/2017 9
Interpolation Algorithm Accept n sample points Consider first 4 sample points Calculate intermediate value of u and determine intermediate points Calculate blending function values for First section of the curve Calculate blending function values for middle section of the curve Approximate points and join points with line segment. Skip first point and add next sample point Approximate curve for middle section At last approximate last section of the curve. DYPCOE, Akurdi, 3/31/2017 10
Interpolating Polygon The sides are rounded by means of blending functions There are no first and last sections Every time polygon side smooths out with number of small lines 11
Drawbacks of Interpolation Technique 1. Blending functions were designed to sum to 1at every value of u which is not true for fractional values. 2. Slopes of two lines meeting at sample point are different so get corners instead of smooth curves. B-Splines can be used to overcome these 12
Bézier Spline Curves 13
Bézier Curves Consider the case of n+1 control points denoted as p k =(x k, y k, z k ) where k varies from 0 to n The coordinate positions are blended to produce the position vector P(u) which describes the path of the Bézier polynomial function between p 0 and p n P( u) n k 0 p k BEZ ( u), 0 u k, n 1 14
Bézier Curves (cont ) The Bézier blending functions BEZ k,n (u) are the Bernstein polynomials BEZ k, n ( u) k nk C( n, k) u (1 u) where parameters C(n,k) are the binomial coefficients n! C( n, k) k!( n k)! 15
Bézier Curves (cont ) So, the individual curve coordinates can be given as follows n k n k k u BEZ x u x 0, ) ( ) ( n k n k k u BEZ z u z 0, ) ( ) ( n k n k k u BEZ y u y 0, ) ( ) ( 16
Important Properties Of Bézier Curves The first and last control points are the first and last point on the curve P(0) = p 0 P(1) = p n The curve lies within the convex hull as the Bézier blending functions are all positive and sum to 1 n k 0 BEZ k, n( u) 1 17
Midpoint Approach for Bezier Curve 18
Fractal Fractals are rough or fragmented geometric shaped object that is both self-similar and chaotic. self-similar: Fractal that can be subdivided into parts, each of which is exactly or statistically a reduced-size copy of the whole chaotic: Fractals are infinitely complex. These beautiful objects of large complexity are generated by mathematical processes. 19
Hilbert Curve Order 1 Order 2 Order 3 20
Triadic Koch Curve N = Number of self similar copies S = scale factor D = dimension N= S D 4 = 3 D D=log4/log3 = 1.26 21
The Intel i860 64 Bit Processor[2] 22
Kepler GK110 Full chip block diagram[3] 23
SMX processor architecture [3] 24
References [1] S. Harrington, Computer Graphics, 2nd Edition, McGraw-Hill Publications, 1987, ISBN 0 07 100472 6. [2] i860_hardware_design_guide_feb89.pdf [3] NVIDIA-Kepler-GK110-Architecture-Whitepaper.pdf 25