Graphics Reference
In-Depth Information
Hyperbolic Geometry
Often when you display highly detailed data, such as a large map, you want
to be able to zoom into an area of interest. This usually forces much of the rest
of the display of the screen, as it does in Figure 15.4.
What if you wanted to simply force the rest of the display to the edges of
the screen, but not off it? One answer is to use hyperbolic geometry , which can
be implemented very effectively in a vertex shader.
The reason for using hyperbolic geometry is to create a mathematical
process that moves the parts of the scene farthest from the area of interest,
asymptotically towards the edges of the display. One straightforward way of
doing this uses polar coordinates. For a given ( x , y ) coordinate that has already
been translated, you convert it into a polar ( r ,Θ) pair. You leave the angle Θ
alone and manipulate the radius as follows:
r
rk ,
=
r
+
where k is a constant. As r increases, the theme of “something divided by
something a litle bigger” makes this fraction asymptotically approach 1. You
then recombine this new radius with the original Θ to produce a new ( x ′, y ′)
that will always lie within a unit circle.
What does the constant k do? If k were 0, then all r ′ would be 1, that is,
the entire scene would be forced to the edges. If k were ∞, then all r ′ would be
0, that is, the entire scene would be forced to a dot in the center. So adjusting
Figure 15.4. Linear zooming in Euclidean space.
 
Search WWH ::




Custom Search