Graphics Reference
In-Depth Information
If there is no solution, then the quadric misses that pixel. Otherwise, choose the small-
est z and transform the point (x s ,y s ,z,1) back to camera coordinates to compute
shading and texture information at that point.
For shading we need normals, but these are easy to compute for the quadric
defined by equation (14.17) because it corresponds to the solution to the equation
(14.16) with f(x,y,z) = h(x,y,z,1) and the normal at (x,y,z) to a surface defined by an
equation like (14.16) is just —f(x,y,z). Fix w and define s(x,y,z) = (xw,yw,zw,w). Then
f = hs. Therefore, applying the chain rule
4
f
x
s
h
x
Â
i
=
Dh
=
w
,
i
x
i
=
1
where s i is the ith component function of s. Similarly,
f
y
h
y
f
z
h
z .
==
w
and
=
w
This shows that —f is a multiple of
h
x
h
y
h
z
Ê
Ë
ˆ
¯
,
,
.
Differentiating equation (14.17) with respect to x gives
1
0
0
0
Ê
ˆ
Á
Á
Á
˜
˜
˜
h
x
(
)
=
2
xyzwQ
,
Ë
¯
with similar formulas for the other partials. Finally, we can combine these facts to
conclude that
100
010
001
000
Ê
ˆ
Á
Á
Á
˜
˜
˜
(
)
NxyzwQ
=
2
(14.20)
Ë
¯
is a normal to the quadric at the point (x/w,y/w,z/w).
Once one finds one visible point one does not need to check all the remaining
pixels on the screen. It is possible to be more efficient and restrict the remaining pass
to a smaller subset. Subsequent z and normal vector computations can also be speeded
up by making incremental computations. The reader is referred to [Bloo97] for the
details.
Moving on to the general case, an approach to getting a piecewise linear approx-
imation to a solution to equation (14.16) and higher dimensional analogs in the case
Search WWH ::




Custom Search