Graphics Reference
In-Depth Information
A
15
3
y
0
12
0
8
local
x
20
28
global
x
x
FIGURE 4.10
Two-dimensional coordinate grid used to locate initial position of vertices.
12 to 15 in
y
. Vertex
A
in the figure has global coordinates of (25.6, 14.7). The local coordinates of
vertex
A
would be (5.6, 2.7).
The grid is then distorted by the user moving the vertices of the grid so that the local space is dis-
torted. The vertices of the object are then relocated in the distorted grid by bilinear interpolation relative
to the cell of the grid in which the vertex is located (
Figure 4.11
)
.
The bilinear interpolants used for vertex A would be 0.6 and 0.7. The positions of vertices of cell (5,
2) would be used in the interpolation. Assume the cell's vertices are named P
00
,P
01
,P
10
, and
P
11
. Bilin-
ear interpolation results in
Equation 4.2
.
P ¼
ðÞ
0
:
6
ð P
00
þ
0
:
7
ðÞ
0
:
6
ð
1
:
0
0
:
7
ÞP
01
þ
ð
1
:
0
0
:
6
Þ
ð P
10
þ
0
:
7
ð
1
:
0
0
:
6
Þ
ð
1
:
0
0
:
7
ÞP
11
(4.2)
(1-u)
P
u
0
(1
u
)
P
00
uP
10
P
u
1
(1
u
)
P
01
uP
11
P
uv
(1
v
)
P
u
0
vP
u
1
(1
u
)(1
v
)
P
00
(1
u
)
vP
01
u
(1
v
)
P
10
uvP
11
P
u
1
P
11
P
01
P
uv
P
00
P
10
P
u
0
FIGURE 4.11
Bilinear interpolation used to locate vertex within quadrilateral grid.
Search WWH ::
Custom Search