Rotational Invariant Coords implementation
Michael Polyakov

I have used wxWidgets library to do all windowing tasks (www.wxWidgets.org)
I have compiled this on Debian Linux, but it should be
compilable on windows with Visual C++ with few modifications.

FILES:
    3dsloader.h,.cpp - loads 3ds files (not mine)
    math3d.h,.cpp - collection of macros and routines for some common math
    mesh.h,.cpp - all the main mesh manipulation here
    test.h,.cpp - wxWidgets code
    trackball.h - quaternion code (not mine)
    jama - folder with jama library I used

I have used jama linear algebra package (couldn't set up
TAUCS appropriately on linux). Because it does not deal 
with sparse matrices, large models will crash because of
insufficient memory. Also, it can be quite long to solve
the least squares system. I have mainly used these 3 model
files:
    cube.3ds
    cube2.3ds
    myship.3ds


USAGE: ./test model_3ds_file


When model is loaded, it can be rotated by dragging
the mouse with left mouse button pressed. To zoom in/out
hold shift and use left mouse button. Hold control to
move model parallel to the screen.

Individual vertices
can be selected with right mouse button. This will highlight
the vertex and show its adjacent faces. To make non of the
vertices highlighted again, press right mouse button on the
black screen (not on the model). (Sometimes, vertices too close to 
the screen will not be selected, in this you have to zoom out)

To toggle between wireframe and fill modes, press F key.
Its visually easier to work in wireframe.

Drawing of local frames at each vertex can be toggled with L key.

To start selecting boundary vertices (those that will be
between the modified vertices and static), press B key. To select
a single vertex, use right mouse button. To select all vertices on
the shortest path between any two vertices, click on the first
vertex using right mouse button, and then drag the mouse over the model.
The path between two vertices will be highlighted in red. Release right
mouse button on any vertex to put all the vertices on the path in the
boundary set. Press B again to leave this mode of choosing boundary vertices.

To select the handle (modified vertices in ROI, which
local frames will be transformed), press H key. Select individual
vertices with right mouse button. Press H to leave this mode.

The set of handle vertices also defines the connected component
bounded by the boundary set which is going to be modified. 
Boundary set has to divide the model into two connected
components.

Next, press S key to select the transformation to be done on the
handle. The frames of handle vertices will be shown (if all the
frames are currently shown, press L key to hide them). Drag
the mouse with right mouse button pressed to rotate the frames on
the handle vertices. This will define the transformation applied to
the handle and propagated throughout the connected component. Its
still possible to rotate the model using left mouse button.

When the needed transformation is chosen, press S again. This will
build the necessary matrices and solve the system using least squares.
This can take a while (or crash if there is not enough memory to 
hold the matrices). When it is done, the matrices computed will be 
printed on the console. To toggle between the original model
and the modified version, use '1' key. 
