Documente Academic
Documente Profesional
Documente Cultură
Interactive Graphics Lecture 14: Slide 1 Interactive Graphics Lecture 14: Slide 2
x y z 1 a b c d x = 0
b e f g y
c f h i z ax2+ey2+hz2+2bxy+2cxz+2fyz+2dx+2gy+2iz+1 = 0
d g i 1 1
The matrix formulation is a good way of expressing We have 9 unknowns, so we need to be able to supply
polynomial equations. 9 points from which we obtain 9 equations and can
solve for coefficients [a..i]
This formulation suffers the same problems as the We can extend the formulation to simple parametric
non-parametric spline curve. It is a fixed surface for a surfaces
given set of knots.
Interactive Graphics Lecture 14: Slide 5 Interactive Graphics Lecture 14: Slide 6
1
Or if multiplied out Surface Edges
P(µ,ν) = aµ 2 + 2bµν + 2cµ + dν2 + 2eν +f P(µ,ν) = aµ2 + 2bµν + 2cµ + dν2 + 2eν + f
We have six vector unknowns in this equation, so we The boundary of the surface is given by the four
need six points to create a surface. curves where:
This time we have two parameters, and as before we µ=0 P(0,ν) = dν2 + 2eν + f
will restrict them to the range [0..1] µ=1 P(1,ν) = dν2 + 2(e+b)ν + f + a + 2c
ν=0 P(µ,0) = aµ2 + 2cµ + f
ν=1 P(µ,1) = aµ2 + 2(b+c)µ + d + 2e + f
Interactive Graphics Lecture 14: Slide 7 Interactive Graphics Lecture 14: Slide 8
We can solve for the unknowns by substituting in six This data then gives us six equations in the unknowns
points at known values of ν and µ. We might have an which we can solve using standard methods.
arrangement such as: P0 = f
µ ν P1 = d + 2e + f
P0 0 0 P2 = a + 2c + f
P1 0 1 P3 = a + 2b + 2c + d + 2e + f
P2 1 0 P4 = a/4 + c + f
P3 1 1
P5 = a/4 + b + c + d + 2e + f
P4 1/2 0
P5 1/2 1
Interactive Graphics Lecture 14: Slide 9 Interactive Graphics Lecture 14: Slide 10
Interactive Graphics Lecture 14: Slide 11 Interactive Graphics Lecture 14: Slide 12
2
A higher order tensor product Cubic Spline Patches
Interactive Graphics Lecture 14: Slide 13 Interactive Graphics Lecture 14: Slide 14
Interactive Graphics Lecture 14: Slide 15 Interactive Graphics Lecture 14: Slide 16
∂P(µ,ν) ∂P(µ,ν)
P(µ,ν)
∂µ ∂ν
∂y
∂z
Interactive Graphics Lecture 14: Slide 17 Interactive Graphics Lecture 14: Slide 18
3
Corners Edges
As usual we adopt the convention that the corners are We do this by designing the edge curves in an
at parameter values (0,0) (0,1) (1,0) and (1,1) identical manner to the cubic spline curve patch.
We need to ensure that the patch joins its neighbours P(0,ν) joining Pi,j to Pi,j+1
exactly at the edges. P(1,ν) joining Pi+1,j to Pi+1,j+1
P(µ,0) joining Pi,j to Pi+1,j
Hence we ensure that the edge contours are the same P(µ,1) joining Pi,j+1 to Pi+1,j+1
on adjacent patches
Interactive Graphics Lecture 14: Slide 19 Interactive Graphics Lecture 14: Slide 20
Interactive Graphics Lecture 14: Slide 21 Interactive Graphics Lecture 14: Slide 22
Interactive Graphics Lecture 14: Slide 23 Interactive Graphics Lecture 14: Slide 24
4
Choosing the polygon size Lofting
For speed we can use large polygons with Gouraud or Surfaces can also be drawn by a technique called
Phong shading. lofting.
For accuracy we use small polygons, chosen to match This means drawing contours of constant µ and of
the pixel size. constant ν
Interactive Graphics Lecture 14: Slide 25 Interactive Graphics Lecture 14: Slide 26
The patch equation is fourth order 1. Polygonise the patch at a low resolution (say 4*4)
P(µ,ν) = P(µ,0)(1-ν) + P(µ,1)ν + P(0,ν)(1-µ) + P(1,ν)µ - 2. Calculate the ray intersection with the 32 triangles
P(0,0)(1-ν)(1-µ) - P(0,1)ν(1-µ) - P(1,0)(1-ν)µ - P(1,1)νµ and find the nearest intersection.
Hence no closed form solution exists for a ray patch 3. Polygonise the immediate area of the insection and
intersection. calculate a better estimate of the intersection
There are various numeric algorithms. 4. Continue until the best estimate is found
Interactive Graphics Lecture 14: Slide 27 Interactive Graphics Lecture 14: Slide 28
This algorithm will find a root, but it is not Part of a terrain map defined on a regular x,y grid is as
guaranteed to find the nearest root. follows: y,ν
3 4 5 6
However, it the object is relatively smooth it should 8 10 9
work well in all cases. 9 14 12 11 10
x,µ
10 15 13 14 10
Note that it will be necessary to do a ray intersection 11 10 11
with each patch of the object to find the nearest
intersection.
Find the Coons patch on the centre four points
Interactive Graphics Lecture 14: Slide 29 Interactive Graphics Lecture 14: Slide 30
5
Corners Gradients in the x (µ) direction
The corners are defined directly in the question: ∂P/dµ (at P(0,0)) = ((10,4,13) - (8,4,10))/2 = (1,0,1.5)
Interactive Graphics Lecture 14: Slide 31 Interactive Graphics Lecture 14: Slide 32
(10,4,13)
µ
Solving for the constants a0 - a3 Solving for the curves P(µ,1), P(0,ν) and P(1,ν)
6
So, for any given value for µ and ν
P(µ,ν) =
P(µ,0)(1-ν) + P(µ,1)ν + P(0,ν)(1-µ) + P(1,ν)µ -
P(0,0)(1-ν)(1-µ) - P(0,1)ν(1-µ) -
P(1,0)(1-ν)µ - P(1,1)νµ