Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

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


By Vaishali Kolhe
DDA Arc Generation Algorithm[1]

DYPCOE, Akurdi, Pune 3/31/2017 3


By Vaishali Kolhe
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
By Vaishali Kolhe
Interpolation

Unknown Curve Known Sample Points

DYPCOE, Akurdi, 3/31/2017 5


By Vaishali Kolhe
Interpolation
 Suitable mathematical equations are used
to approximate the curve
 Polynomial functions in parametric form
is used
X=fx(u)
Y=fy(u)
Z=fz(u)

 Polynomial curve is passing through n


sample points (x1,y1,z1)….(xn,yn,zn)

DYPCOE, Akurdi, 3/31/2017 6


By Vaishali Kolhe
Interpolation
 The function can be given as
fx(u)= sum from i = 1 to n of x[i] B[i](u)
fy(u)= sum from i = 1 to n of y[i] B[i](u)
fz(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


By Vaishali Kolhe
Interpolation
 LeGRANGE INTERPOLATED CURVES
 U= -1, 0, 1….
 If u= -1 , B1(u) = 1 and 0 for u=0, 1, 2..n-2
 If u= 0 , B2(u) = 1 and 0 for u= -1, 1, 2..n-2

Lagrange Interpolation Expression is given as

DYPCOE, Akurdi, 3/31/2017 8


By Vaishali Kolhe
Interpolation
Blending functions for four sample points are give as per below

DYPCOE, Akurdi, 3/31/2017 9


By Vaishali Kolhe
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
By Vaishali Kolhe
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

DYPCOE, Akurdi, Pune 3/31/2017 11


By Vaishali Kolhe
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


DYPCOE, Akurdi, Pune 3/31/2017 12
By Vaishali Kolhe
Bézier Spline Curves

DYPCOE, Akurdi, Pune 3/31/2017 13


By Vaishali Kolhe
Bézier Curves
 Consider the case of n+1 control points denoted
as pk=(xk, yk, zk) 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
p0 and pn
n
P(u )   pk BEZ k ,n (u ), 0  u 1
k 0

DYPCOE, Akurdi, Pune 3/31/2017 14


By Vaishali Kolhe
Bézier Curves (cont…)
 The Bézier blending functions BEZk,n(u)
are the Bernstein polynomials
nk
BEZ k ,n (u )  C (n, k )u (1  u )
k

 where parameters C(n,k) are the binomial


coefficients
n!
C (n, k ) 
k!(n  k )!
DYPCOE, Akurdi, Pune 3/31/2017 15
By Vaishali Kolhe
Bézier Curves (cont…)
 So, the individual curve coordinates can
be given as follows
n
x(u )   xk BEZ k ,n (u )
k 0
n
y (u )   yk BEZ k ,n (u )
k 0
n
z (u )   z k BEZ k ,n (u )
k 0

DYPCOE, Akurdi, Pune 3/31/2017 16


By Vaishali Kolhe
Important Properties Of Bézier
Curves
 The first and last control points are the
first and last point on the curve
◦ P(0) = p0
◦ P(1) = pn
 The curve lies within the convex hull as
the Bézier blending functions are all
positive and sum to 1
n

 BEZ
k 0
k ,n (u )  1
DYPCOE, Akurdi, Pune 3/31/2017 17
By Vaishali Kolhe
Midpoint Approach for Bezier Curve

DYPCOE, Akurdi, Pune 3/31/2017 18


By Vaishali Kolhe
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.

DYPCOE, Akurdi, Pune 3/31/2017 19


By Vaishali Kolhe
Hilbert Curve

Order 1 Order 2 Order 3

DYPCOE, Akurdi, Pune 3/31/2017 20


By Vaishali Kolhe
Triadic Koch Curve

N = Number of self similar


copies
S = scale factor
D = dimension

N= SD
4 = 3D
D=log4/log3 = 1.26…

DYPCOE, Akurdi, Pune 3/31/2017 21


By Vaishali Kolhe
The Intel i860 64 Bit Processor[2]

DYPCOE, Akurdi, Pune 3/31/2017 22


By Vaishali Kolhe
Kepler GK110 Full chip block
diagram[3]

DYPCOE, Akurdi, Pune 3/31/2017 23


By Vaishali Kolhe
SMX processor architecture [3]

DYPCOE, Akurdi, Pune 3/31/2017 24


By Vaishali Kolhe
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

DYPCOE, Akurdi, Pune 3/31/2017 25


By Vaishali Kolhe

You might also like