Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear...
-
Upload
kelley-burns -
Category
Documents
-
view
212 -
download
0
Transcript of Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear...
![Page 1: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/1.jpg)
Parametric Surfaces• Define points on the surface in terms of two parameters
• Simplest case: bilinear interpolation
s
t
s
x(s,t)
P0,0
P1,0
P1,1
P0,1
x(s,0)
x(s,1)
1
0
1
0,,,
,1,0
,1,0
1,11,0
0,10,0
)()(),(
,1
,1
)1,()0,()1(),(
)1()1,(
)1()0,(
i jtjsiji
tt
ss
tFsFPtsx
tFtF
sFsF
stxsxttsx
sPPssx
sPPssx
![Page 2: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/2.jpg)
Tensor Product Surface Patches• Defined over a rectangular domain
– Valid parameter values come from within a rectangular region in parameter space: 0s<1, 0t<1
• Use a rectangular grid of control points to specify the surface– 4 points in the bi-linear case, more in other cases
• Surface takes the form:
s td
i
d
jtjsiji tFsFts
0 0,,, )()(),( Px
![Page 3: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/3.jpg)
Bezier Patches
• As with Bezier curves, Bin(s) and
Bjm(t) are the Bernstein polynomials
of degree n and m respectively• Most frequently, use n=m=3: cubic
Bezier patch– Need 4x4=16 control points, Pi,j
n
i
m
j
mj
niji tBsBts
0 0,, Px
![Page 4: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/4.jpg)
Bezier Patches (2)• Edge curves are Bezier curves• Any curve of constant s or t is a Bezier curve• One way to think about it:
– Each row of 4 control points defines a Bezier curve in s– Evaluating each of these curves at the same s provides 4 virtual control points– The virtual control points define a Bezier curve in t– Evaluating this curve at t gives the point x(s,t)
x(s,t)
![Page 5: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/5.jpg)
Properties of Bezier Patches• The patch interpolates its corner points
– Comes from the interpolation property of the underlying curves
• The tangent plane at each corner interpolates the corner vertex and the two neighboring edge vertices– The tangent plane is the plane that is perpendicular to the normal
vector at a point
– The tangent plane property derives from the curve tangent properties and the way to compute normal vectors
• The patch lies within the convex hull of its control vertices– The basis functions sum to one and are positive everywhere
![Page 6: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/6.jpg)
Bezier Patch Matrix Form
• Note that the 3 matrices stay the same if the control points do not change– The middle product can be pre-computed, leaving only:
10001
0033
0363
1331
0001
0033
0363
1331
1),(
),(
2
3
3,32,31,30,3
3,22,21,20,2
3,12,11,10,1
3,02,01,00,0
23
t
t
t
PPPP
PPPP
PPPP
PPPP
ssstsx
PBTBStsx TT
1
1),(2
3
3,32,31,30,3
3,22,21,20,2
3,12,11,10,1
3,02,01,00,0
23
t
t
t
MMMM
MMMM
MMMM
MMMM
ssstsx
![Page 7: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/7.jpg)
Bezier Patch Meshes• A patch mesh is just many patches joined together along
their edges– Patches meet along complete edges– Each patch must be rectangular
OKOK Not OK Not OK
![Page 8: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/8.jpg)
Bezier Mesh Continuity• Just like curves, the control points must satisfy rigid
constraints to ensure parametric continuity– How do we ensure C0 continuity along an edge?
– How do we ensure C1 continuity along an edge?
– How do we ensure C2 continuity along an edge?
• For geometric continuity, constraints are less rigid
• What can you say about the vertices around a corner if there must be C1 continuity at the corner point?
![Page 9: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/9.jpg)
Bezier Mesh Continuity• Just like curves, the control points must satisfy rigid
constraints to ensure parametric continuity– C0 continuity along an edge? Share control points at the edge– C1 continuity along an edge? Control points across edge are
collinear and equally spaced– C2 continuity along an edge? Constraints extent to points farther
from the edge
• For geometric continuity, constraints are less rigid– Still collinear for G1, but can be anywhere along the line
• What can you say about the vertices around a corner if there must be C1 continuity at the corner point?– They are co-planar (not the interior points, just corner and edge)
![Page 10: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/10.jpg)
Rendering Bezier Patches• Option 1: Evaluate at fixed set of parameter values and
join up with triangles– Can’t use quadrilaterals because points may not be co-planar
– Ideal situation for triangle strips
– Advantage: Simple, and OpenGL has commands to do it for you
– Disadvantage: No easy way to control quality of appearance
• Option 2: Subdivide– Allows control of error in the triangle approximation
– Defined much like curve subdivision, but done once in each parametric direction
![Page 11: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/11.jpg)
Midpoint Subdivision• Repeatedly join midpoints to find new control vertices
– Do it first for each row of original control points: 4x4 -> 4x7
– Then do it for each column of new control points:4x7 -> 7x7
![Page 12: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/12.jpg)
A Potential Problem• One (good) way to subdivide, is:
– If a control mesh is flat enough – draw it– Else, subdivide into 4 sub-patches and recurse on each
• Problem: Neighboring patches may not be subdivided to the same level– Cracks can appear because join edges have different control
meshes– This can be fixed by carefully shifting vertices around
• Make more highly subdivided match less subdivided along edges
Crack
![Page 13: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/13.jpg)
Computing Normal Vectors• The partial derivative in the s direction is one tangent
vector
• The partial derivative in the t direction is another
• Take their cross product, and normalize, to get the surface normal vector
n
i
m
j
mj
s
ni
jits
tBds
dB
s 0 0,
,
Px
n
i
m
j t
mjn
ijits dt
dBsB
t 0 0,
,
Px
n
nn
xxn
ˆ ,, tsts ts
![Page 14: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/14.jpg)
B-spline Patches
• Bi(s) and Bj(t) are the B-spline blending functions
• Uniform B-spline patches use uniform knot vectors in each parametric direction
n
i
m
jjiji tBsBts
0 0,, Px
![Page 15: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/15.jpg)
Evaluating B-spline Patches• Use the same trick as with curves:
– All the blending functions are translations of each other
– Find: a=floor(s), b=floor(t)
– Compute: u=s-a, v=t-b
– Use blending functions for [0,1) interval given in last lecture for B-spline curves
3
0
3
0,,
i jjijbia vBuBts Px
![Page 16: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/16.jpg)
B-spline Patch Properties• Patch lies within convex hull of control vertices• Continuity is automatically C2 for uniform cubic B-splines• Interpolation can be forced by duplicating control vertices
– Problem: Partial derivatives will vanish, resulting in undefined normal vectors
– Solution: use normal from control polygon, or use normal from a nearby point on the surface
• Interpolation and changing in continuity can be achieved with non-uniform B-splines
• NURBS patches can also be defined– Definition follows directly from NURBS curves, but now all
coordinates are functions of s,t
![Page 17: Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.](https://reader036.fdocuments.us/reader036/viewer/2022083006/56649f315503460f94c4c450/html5/thumbnails/17.jpg)
B-spline Patch Subdivision• We’ll look at this next lecture, in the context of
subdivision surfaces