CS 453/553 -- Spring Quarter 2019

Project #4: Hyperbolic Geometry

80 Points

Due: April 29


This page was last updated: April 16, 2019


Requirements:

  1. Put this project number and your name in the title bar.

  2. Using hyperbolic geometry, draw a map of the United States (or something else of your own choosing)

  3. Allow the user to interactively translate the map.

  4. Use a GLUI spinner or one-handle slider (first argument = false) to change the value of K.
    GLUI_HSlider * KSlider = Glui->add_slider( false, GLUI_HSLIDER_FLOAT, &Kvalue, 0, (GLUI_Update_CB) Sliders );

  5. Toggle between polar and Cartesian hyperbolic transformations with a checkbox.

Applying The Hyperbolic Geometry Equations:

For each original Cartesian coordinate pair (x,y):

  1. Translate the original x,y by the current translation amount to create a new x',y'.
    Do this by adding the translation values to create a new x.y.
    x' = x + Tx
    y' = y + Ty
    Don't do it with glTranslatef( ).

  2. For Hyperbolic-Polar:

  3. For Hyperbolic-Cartesian, use:
    x'' = x' / sqrt( x'*x' + K*K )
    y'' = y' / sqrt( y'*y' + K*K )

  4. Then plot that new (x'',y'') point.

Reading and Storing the United States Data

Suggestions:

As this is a pure 2D application:

+5 Points Extra Credit:

Because hyperbolic geometry uses a nonlinear equation, but we are drawing long lines, you get display cracks where there are T-intersections in the model, like this:

Break each line segment into many line segments so that long straight lines appear curved as shown here:


x = (1.-t) * x0  +  t * x1
y = (1.-t) * y0  +  t * y1

0. <= t <= 1.

Grading:

Item Points
Draw a USA-looking map 10
Draw a correct Polar USA map 20
Draw a correct Cartesian USA map 20
Translation 10
Change K with a GLUI spinner or slider 20
Extra Credit 5
Potential Total 85

Corvallis: