3D Object Representation

You might also like

You are on page 1of 18

June 2010 1

3D Object Representation
Shmuel Wimer
Bar Ilan Univ., School of Engineering
June 2010 2
Spline Representation
Spline is a flexible strip used to produce a smooth curve through a set of
points. Splines are used to design curve and surface shapes like automobile
bodies, aircrafts, home appliances and more.

Cubic splines are most popular. given a set of 1 control points
, , , 0,1, , , a cubic interpolation fits the points.
k k k k
n
x y z k n
+
= = p
0
p
n
p
k
p
1 k +
p


3 2 3 2
3 2
,
, 0 1.
x x x x y y y y
z z z z
x u a u b u c u d y u a u b u c u d
z u a u b u c u d u
= + + + = + + +
= + + +
June 2010 3
At each of n-1 internal point we require that two successive curve sections
pass through that point and also the equality of their 1
st
and 2
nd
derivatives,
thus imposing 4(n-1) equations of 4n polynomial coefficients. Two more
equations are obtained from passing through the first and last points. The
last two equations can be obtained by requiring the 2nd derivative at first
and last points to be zero.
A major drawback is that a change in the position of one control point needs
recalculation of all coefficients. This is solved by specifying the tangent at
each control point. Then, a change in position of one point affects only two
sections of the curve. This is called Hermite interpolation.

, , u x u y u z u = P
k
p
1 k+
p


1 1
0 0
1 1
k k
k k + +
' = =
' = =
P p P Dp
P p P Dp
is parametric derivative (curve slope).
k
Dp
June 2010 4


3 2
3 2
There is , 0 1. The component of is
and similarily for and .
x x
u u u u u x u
x u a u b u cu d y z
= + + +
= + + +
P a b c d P

3 2 2
1 , 3 2 1 0 u u u u u u u



' = =
| |


| |
a a
b b
P P
c c
d d
1 1
1 1
0 0 0 1 2 2 1 1
1 1 1 1 3 3 2 1

0 0 1 0 0 0 1 0
3 2 1 0 1 0 0 0
k k
k k
k k
k k
H
+ +
+ +





= =


| | | | | |
p p a a
p p b b
Dp Dp c c
Dp Dp d d
M

The inverse boundary constraints matrix is called matrix.


H
M Hermite
June 2010 5









1
1 3 2
1
3 2 3 2
1
3 2 3 2
1
0 1
2 3
The curve segment between the constraint points and is therefore
1
2 3 1 2 3
2
k k
k
k
H
k
k
k k
k k
H u H u
H u H u
u u u u
u u u u
u u u u u
+
+
+
+
+



= =
|


|
+ + +
+ + +
p p
p
p
P M
Dp
Dp
p p
Dp Dp



, 0,1, 2, 3, are called
i
H u i =
Hermite Blending Functions.
0
H
1
H
3
H
4
H
June 2010 6
Other Splines
The requirements of curve derivative values control point may be a problem.
Instead, the derivatives can naturally be defined based on the control points.
In Cardinal splines a curve section is completely defined by the position of
four consecutive points.
1 k
p
k
p
1 k+
p
2 k +
p


1 1
1 2
1
0 , 0 1 ,
2
1
1 , 0 1 .
2
is called parameter, controlling how
loosely or tightly it fits the control points.
k k k
k k k
t
t
t
+
+ +
'
= =
' = =
P p P p p
P p P p p
tension
June 2010 7
t < 0: looser curve
t > 0: tighter curve
Cardinal matrix and blending functions are derived similarly as in Hermite
splines. Setting s=(1-t)/2
June 2010 8







1
3 2
1
2
3 2 3 2
1
1 0
3 2
1
2
2 2
2 3 3 2
1
0 0
0 1 0 0
2 2 3 1
CAR CAR
2 3 2
CAR
k
k
k
k
C
k k
k
s s s s
s s s s
u u u u
s s
su su su s u s u
u u
s u s u su
u

+
+

+




= =
|


| |
+ + + +
|
+ + +
|
p
p
P
p
p
M
p p
p





3 2
2
3
CAR
k
su su
u
+
+ p


CAR , 0,1, 2, 3, are called
i
u i = Cardinal Blending Functions.
June 2010 9
There are few more splines with more parameters than tension, designed
to model animation paths with abrupt changes in motion.
June 2010 10
Bezier Spline Curves
Developed by Pierre Bezier at Renault corporation for the design of automobile
bodies. Bezier splines are very useful for design of curves and surfaces.





0
,
0
,
Let , , , 0 , be 1 control points, blended
to create a position vector describing a path from to .
BEZ , 0 1, where
!
BEZ , 1 , ,
! !
k k k k
n
n
k k n
k
n k
k
k n
x y z k n n
u
u u u
n
u C n k u u C n k
k n k
=

= +
=
= =

p
P p p
P p
Bezier curve is a polynomial of degree one less the number of control points.
Coefficients and blending functions satisfy recursive relations as follows:
June 2010 11



, , 1 1, 1
, 0,
1
, , 1 ,
BEZ 1 BEZ BEZ , 1, with
BEZ and BEZ 1 .
k n k n k n
k
k
k k k
n k
C n k C n k n k
k
u u u u u n k
u u u u

+
= >
= + > >
= =
0
p 2
p
1
p
1
p
2
p
3
p
0
p
0
p
7
p
June 2010 12
Properties of Bezier Curves

0
A useful property is that the curve connects to first and last control
points: 0 , 1 .
n
= = P p P p

0 1 1
The parametric derivative at the end control points is given by:
0 , 1 .
The slope of the cure at the ens points is along the line joining the
last two end points.
n n
n n n n

' '
= + = + P p p P p p


2 1 1 0
2 1 1
The parametric second derivatives is given by:
0 1 ,
1 1 ,
n n n n
n n
n n

'' =
|
'' =
|
P p p p p
P p p p p
June 2010 13

,
Another important property of any Bezier curve is its containment in the
convex hall of the control point. This follows from being a positive
sum of the control points where sum of weights is BEZ
k n
u P

0
1.
n
k
u
=
=

Cubic Bezier Curves


Bezier curves with many points are expensive to compute due to high degree
of polynomials. It is common to patch curves of four points and construct it
from piecewise cubic curves.

3 2
2 3
0,3 1,3 2,3 3,3
BEZ 1 , BEZ 3 1 , BEZ 3 1 , BEZ . u u u u u u = = = =
The following illustrates the four blending functions and how they relate to
various curves.
June 2010 14
June 2010 15

0
1 3 2
2
3
Bez
1 3 3 1
Polynomial 3 6 3 0
1
expansion yields: 3 3 0 0
1 0 0 0
u u u u



=
|


| |
p
p
P
p
p
M

Complex curves can be constructed by patching cubic Bezier splines. Given


two control points, in order to obtain C
1
continuity of the patch a new point
is introduced and its position is defined by equation the expression of first
derivative for u=1 with the next one for u=0. If C
2
continuity is desired, a
second point is introduces and the expressions of the second derivatives
are also equated.
June 2010 16
Displaying Spline Curves and Surfaces
We must determine positions of points on curves and surfaces for displaying
those. Parametric polynomial splines must be calculated by steps increments
over range of parameter, e.g. [0,1]. This is very time consuming and efficient
computations methods are in order.


3 2
Consider a cubic spline . Applying
requires 4 additions
and 3 multiplications. This must be repeared for every displayed
point, which is ver
x x x x
x x x x
x u a u b u c u d
x u a u b u c u d
= + + +
= + + +
|
Horner's rule
y expensive.
A method called Forward-Difference is very efficient and requires mostly
additions.
June 2010 17
? A


0 1
1 1
3 2
1
3 2
Let us increase 0,1 in steps 0, , 0,1, 2,
This results corresponding increments in . Substitution
of in yields:
k k
k k k
k
k x k x k x k x
x k x k x k x
k
u u u u k
x x x x
u x u
x a u b u c u d
a u b u c u d
x
H
H
H H H
+
+
+
= = + =
= + A
+
= + + + + + + =
+ + +


2 2 3 2
1
3 3 2
x k x x k x x x
k
a u a b u a b c
x
H H H H H H + + + +
A
+ +



1 1 1 1 2
1
2
2 3 2
1
2
1
3 2
2
is quadratic polynomial of . . Substitution
of in yields
= 3
6 6 2
3 2
k k k k
k k
k k x k
x k x x
k
x x k x x x
k k
x u x x x
u x
x u a u a b u a b c
x u a u a b
x
H
H H H H H H H H
H
H
H H
+
A A = A + A
+ A
A + +
+
+ + + + + +
A
A
=
+ +

June 2010 18

,
2
2
3
3
3 2
2
Similarily,
6 6 2 6
k k x k x x k x
k
a x u a u a b x
x
H H H H H H A + = + + + =
A
A +
3 2
0 0 0 1 0
3 2 3
2 0
At there exists 0. Hence , ,
6 2 and 6 .
x x x x
x x x
x u x d x a b c
x a b a
H H H
H H H
= = A = + +
A = +
1 0 1 2 1 1 2 3 2 1 2 3
4 1 1
3 1 2 3
Then , , and .
can be derived from by considering as a starting point
and progressing with 3 forward differences.
Hence 3 2 , requiring only 3 add
i i
x x x x x x
x x x
x x
+
= + A = + A + A = + A + A + A
= + A + A + A itions for
eavery new point.

You might also like