Graphics Reference
In-Depth Information
this difficult subject. Currently, solutions to numerical problems tend to be targeted
to specific areas. What are still needed are general solutions. In the meantime it is
largely up to users to be aware of potential problems and to take steps on their own
to try to avoid them.
One of the first things one learns about real numbers when programming is that
one almost never tests for equality but rather asks whether numbers are close enough.
Modeling systems tend to use plenty of epsilons, small positive constants that are used
to define when quantities are supposed to be considered equal. Getting correct yes/no
answers when one only has approximations is not easy. So often the mathematical
answer to a geometric problem is short and simple, but the computer program that
implements it is much longer and messy. For example, to determine whether a point
in the plane lies on a line is trivial mathematically. One can simply check whether the
point satisfies the equation of the line, which involves checking whether some expres-
sion equals zero. In a computer program, testing for zero would probably be too
strong a test and one would be satisfied if the expression is suitably small. This might
not cause any problems by itself, but errors can propagate. Treating two lines as par-
allel if they are only almost parallel might be all right, but if a sequence of lines are
almost parallel, then the first and the last might be quite far from being parallel. Fur-
thermore, no matter how small the epsilons, there is a potential of getting inconsis-
tencies in the geometric database. In Figure 5.48, if the segment AB is close to being
parallel to the top face f of the solid, then in the process of intersecting it with the
solid, one may conclude that AB intersects the face f in the segment CD . On the other
hand, one may get a more accurate intersection with the side face g and conclude in
that case that the line does not intersect CD . This might leave an incorrect descrip-
tion of AB in the database as a composition of three segments. The author has per-
sonally known of commercial CAD systems that (at least in their initial version) would
crash in some constructions that involved solids that touched each other along essen-
tially parallel faces.
Maintaining the orthogonality of orthogonal matrices is another problem in com-
puter graphics. Orthogonal matrices may become nonorthogonal after numerous
transformations. This is a serious problem in robotics where moving joints means
transforming matrices. What one needs to do here is to maintain a count of the
number of transformations that have been performed and then periodically reorthog-
onalize the matrices. Of course, since one does not know which values are incorrect,
the new matrices, although orthogonal, are probably not what they should be
mathematically.
Figure 5.48.
Intersection inconsistencies due to
round-off errors.
Search WWH ::




Custom Search