1` lim = R 0` lim = R - College of Engineering | Oregon State University

Zooming and Panning Around a Complex 2D Display
Using Vertex Shaders for Hyperbolic Geometry
• Standard (Euclidean) geometry zooming forces much of the
information off the screen
• This eliminates the context from the zoomed-in display
• This problem can be solved with hyperbolic methods if we are willing
to give up Euclidean geometry
Mike Bailey
[email protected]
• At one time,
time this would have also meant severely giving up graphics
performance, but not now
Oregon State University
hyperbolic.pptx
mjb – January 15, 2015
Zooming in Euclidean Space
mjb – January 15, 2015
Zooming in Polar Hyperbolic Space
123,101 line strips
446,585 points
mjb – January 15, 2015
Polar Hyperbolic Equations
Polar Hyperbolic Equations
Overall theme: something divided by something a little bigger
lim R'  1
K 0
R
mjb – January 15, 2015
R
lim R'  0
K 
1
  tan (
R' 
R’ = R / (R+K)
R
X’ = R’cosΘ’
Y’ = R’sinΘ’
(X,Y)
Θ
Θ’ = Θ
mjb – January 15, 2015
X 2 Y2
Y
)
X
R
RK
Coordinates moved to outer edge
when K = 0
Coordinates moved to center when K = ∞
X '  R ' cos  
R
X
X
 
RK R RK
Y '  R ' cos  
R
Y
Y
 
RK R RK
mjb – January 15, 2015
1
Cartesian Hyperbolic Equations
Polar
Cartesian
{
{
X '
X
RK
Y'
Y
RK
X '
Zooming in Cartesian Hyperbolic Space
Coordinates moved to outer edge
when K = 0
Coordinates moved to center when K = ∞
Coordinates moved to outer edge
when K = 0
X
X 2  K2
Coordinates moved to center when K = ∞
Y '
Y
Y2  K2
mjb – January 15, 2015
hyper.vert
mjb – January 15, 2015
hyper.frag
#version 330 compatibility
uniform bool
uPolar;
uniform float
uK;
uniform float
uTransX;
uniform float
uTransY;
out vec4
vColor;
#version 330 compatibility
in vec4 vColor;
out vec4 fFragColor;
void
main( )
{
fFragColor = vColor;
}
void
main( void )
{
vColor = aColor;
vec2
2 pos = ( uModelViewMatrix
M d lVi M t i * aVertex
V t ).xy;
)
pos += vec2( uTransX, uTransY );
float r = length( pos.xyz );
vec4 pos2 = vec4( 0., 0., -5., 1. );
if( uPolar )
pos2.xy = pos / ( r + uK );
else
pos2.xy = pos / ( pos*pos + uK*uK );
gl_Position = uProjectionMatrix * pos2;
}
mjb – January 15, 2015
Corvallis Streets, Buildings, Parks
mjb – January 15, 2015
Kelley Engineering Center
Kelley
Engineering
Center
mjb – January 15, 2015
mjb – January 15, 2015
2