Graphics Reference
In-Depth Information
24.9 Ray Tracing Implicit Surfaces
When we wanted to compute the intersection of a ray (parameterized in the usual
form t
P + t d ) with an implicitly defined sphere, we ended up solving a
quadratic equation in t which arose by writing out F ( P + t d )= 0, where F was the
implicit function defining the sphere. But if the implicit object is more general, it's
possible that the equation F ( P + t d )= 0 might have an enormously complicated
form, and there may be no simple formula for finding its roots. In this case, we
must fall back on numerical techniques for root finding [Pre95].
As we mentioned in Section 24.8.1, if S is an implicit surface defined by a
function F , and T is a linear transformation, then the surface T ( S ) is defined by
F T 1 . As hinted at in Exercises 7.17 and 11.13, the problem of intersecting a
ray t
P + t d with T ( S ) can be recast as the problem of intersecting a different
ray with S . Since T ( S ) is defined by F T 1 , a point of our ray is on T ( S ) exactly
when
F ( T 1 ( P + t d )) = 0.
(24.21)
That's the same equation we get when asking when a point of the ray t
T 1 ( P )+ tT 1 ( d ) is on the surface S . Finding a ray-surface intersection in the
untransformed version of the implicit surface may be straightforward (as we've
seen with the plane and the sphere in earlier chapters). This means that if you're
willing to model a scene by applying transformations to several implicitly defined
shapes like spheres or cylinders, you can ray-trace the scene by taking each
ray, and for each object, apply the inverse of the object's modeling transforma-
tion to the ray's basepoint and direction vector. You then intersect this “back-
transformed” ray with the pretransformed object to find an intersection point Q
and a normal vector n to the object. Applying the modeling transformation to Q
and its normal transformation to n gives the intersection point and normal in world
space.
For scenes of modest complexity, this works well. For highly complex scenes,
it's a better idea to use a bounding-box hierarchy to first determine which trans-
formed implicit shapes the ray has a chance of intersecting, and then do the inter-
section test only on those that pass this test.
24.10 Implicit Shapes in Animation
Implicit curves or surfaces can also be used in animation; within physically
based animation, they play a major role under the name level set methods [OS88].
In such methods, there's some initial object of interest that is defined either by an
implicit equality ( F 0 ( x , y , z )= 0) for surfaces or by an inequality ( F 0 ( x , y , z )
0)
for solids. 3 Various forces act on the surface or solid attempting to deform it in
some way; these, in turn, are treated as attempts to deform the defining function
F 0 . One ends up with a differential equation of the form
F t ( x , y , z )
=
−∇
F t ( x , y , z )
·
v ( x , y , z ) ,
(24.22)
t
3. These methods can also be applied in two dimensions to implicit curves.
 
 
 
 
Search WWH ::




Custom Search