Parametric Surfaces CS 418 Intro to Computer Graphics John C. Hart - - PowerPoint PPT Presentation
Parametric Surfaces CS 418 Intro to Computer Graphics John C. Hart - - PowerPoint PPT Presentation
Parametric Surfaces CS 418 Intro to Computer Graphics John C. Hart y Space Curves Separate into three coordinate functions z x p ( t ) = ( x ( t ), y ( t ), z ( t )) x ( t ) = (1- t ) 3 x 0 + 3 t (1- t ) 2 x 1 + 3 t 2 (1- t ) x 2 + t 3 x 3 y
Space Curves
Separate into three coordinate functions p(t) = (x(t), y(t), z(t)) x(t) = (1-t)3 x0 + 3t(1-t)2 x1 + 3t2(1-t) x2 + t3 x3 y(t) = (1-t)3 y0 + 3t(1-t)2 y1 + 3t2(1-t) y2 + t3 y3 z(t) = (1-t)3 z0 + 3t(1-t)2 z1 + 3t2(1-t) z2 + t3 z3 t x t y t z z x y
Space Curves
Make your own roller-coaster ride
- Camera position along space curve
- Look at point is next position along
space curve (tangent)
- Binormal is cross product of vector
to next position with vector to previous position
- Up direction (normal) is cross
product of binormal with tangent z x y
T N B
Extrusion
- Two 3-D copies of each 2-D curve
- Create a mesh of quads (or tri-strip)
p0(t), p1(t), p0(t+∆t), p1(t+∆t) p0(t) = (x(t),y(t),0) p1(t) = (x(t),y(t),1) p(t) = (x(t),y(t))
Generalized Cylinder
- Construct a 2-D profile curve
q(s) = (a(s), b(s))
- Construct a space curve
p(t) = (x(t), y(t), z(t))
- Construct a Frenet frame at each
point along space curve T(t) = p(t+∆t) – p(t) B(t) = T(t) × -T(t – ∆t) N(t) = B(t) × T(t) (all normalized)
- Plot 2-D curve in (N,B) space
gc(s,t) = p(t) + a(s) N(t) + b(s) B(t)
p(t) p(t+∆t) p(t–∆t) T(t)
- T(t–∆t)
Generalized Cylinder
- Construct a 2-D profile curve
q(t) = (a(t), b(t)) t a b q(t)
Generalized Cylinder
- Construct a 2-D profile curve
q(t) = (a(t), b(t))
- Construct a space curve
p(s) = (x(s), y(s), z(s))
Generalized Cylinder
- Construct a Frenet frame at each
point along space curve t(s) = p(s + ∆s) – p(s) b(s) = t(s) × -t(s – ∆s) n(s) = b(s) × t(s) (all normalized)
Generalized Cylinder
- Construct a 2-D profile curve
q(t) = (a(t), b(t))
- Construct a space curve
p(s) = (x(s), y(s), z(s))
- Plot 2-D curve in (N,B) space
gc(s,t) = p(s) + a(t) n(s) + b(t) b(s)
Generalized Cylinder
- Construct a 2-D profile curve
q(t) = (a(t), b(t))
- Construct a space curve
p(s) = (x(s), y(s), z(s))
- Plot 2-D curve in (N,B) space
gc(s,t) = p(s) + a(t) n(s) + b(t) b(s)
Revolution
- Construct a 2-D profile curve
q(t) = (a(t), b(t))
- Rotate about y axis
p(s,t) = (a(t) cos 2π s, b(t), a(t) sin 2π s) z x y
Bezier Patches
- Bezier patch
– Tensor product of two Bezier curves
∑∑
= =
=
n j n i ij n i n j
t B s B t s p
1 1
) ( ) ( ) , ( p p00 p01 p02 p03 p10 p11 p12 p13 p20 p21 p22 p23 p30 p31 p32 p33
Bezier Patches
- Bezier patch
– Tensor product of two Bezier curves – Product of Bernstein polynomials
∑∑
= =
=
n j n i ij n i n j
t B s B t s p
1 1
) ( ) ( ) , ( p
( )
∑∑
= =
=
n j n i ij n i n j
t B s B t s p
1 1
) ( ) ( ) , ( p p00 p01 p02 p03 p10 p11 p12 p13 p20 p21 p22 p23 p30 p31 p32 p33
Bezier Patches
- Bezier patch
– Tensor product of two Bezier curves – Product of Bernstein polynomials – Bernstein interpolation of Bernstein polynomials
∑∑
= =
=
n j n i ij n i n j
t B s B t s p
1 1
) ( ) ( ) , ( p
( )
∑∑
= =
=
n j n i ij n i n j
t B s B t s p
1 1
) ( ) ( ) , ( p
( )
∑ ∑
= =
=
n j j i n i n i n j
t B s B t s p
1 1
) ( ) ( ) , ( p p00 p01 p02 p03 p10 p11 p12 p13 p20 p21 p22 p23 p30 p31 p32 p33
Bezier Patches
- Bezier patch
– Tensor product of two Bezier curves – Product of Bernstein polynomials – Bernstein interpolation of Bernstein polynomials
- Works same way for B-splines
∑∑
= =
=
n j n i ij n i n j
t B s B t s p
1 1
) ( ) ( ) , ( p
( )
∑∑
= =
=
n j n i ij n i n j
t B s B t s p
1 1
) ( ) ( ) , ( p
( )
∑ ∑
= =
=
n j j i n i n i n j
t B s B t s p
1 1
) ( ) ( ) , ( p p00 p01 p02 p03 p10 p11 p12 p13 p20 p21 p22 p23 p30 p31 p32 p33
Blossoming Patches
- Curves: p(t) p(t,t,t)
- Patches: p(s,t) p(s,s,s;t,t,t)
- Variables not allowed to cross
the semicolon
- In patches, bilinear
interpolation replaces linear interpolation in curves
p(000;000) p(001;000) p(011;000) p(111;000) p(000;001) p(000;011) p(000;111) p(001;001)p(011;001) p(111;001) p(001;011) p(011;011) p(111;011) p(001;011) p(011;111) p(111;111)
Blossoming Patches
- Curves: p(t) p(t,t,t)
- Patches: p(s,t) p(s,s,s;t,t,t)
- Variables not allowed to cross
the semicolon
- In patches, bilinear
interpolation replaces linear interpolation in curves
p(00s;00t) p(01s;00t) p(11s;00t) p(00s;01t) p(01s;01t) p(11s;01t) p(00s;11t) p(01s;11t) p(11s;11t)