A (somewhat) Quick how-to
for shape deformation in ShaRP:
1. Open a VRML or OBJ file.
2. Right click on the filename which appears on the object list to the
right
3. Select Actions -> Edit
4. A Menu will appear to enable the MRF model go to Deformation Control
tab.
Select Activate MRF
5. Add data by
(i) drawing with the cone object which you can control using
Cntrl+Mouse Move / Clicks (see External Device - Interface -
DesktopMouseInterface - 3DMode.SketchData for details)
(ii) loading a second point or mesh file and selecting that file from
the object list then selecting add MRF data source. This will add the
selected object in its shown pose as data points for the MRF
deformation.
6. MRF Interpolation has 4 controls at the moment and will be changing:
Deformation Tab:
MRF Interpolation Controls:
Control 1:
Scale (Point / Patch / Surface) controls the size of the deformation
for
a single point, i.e., how much of the surface reacts to a given data
point. This is controlled via a slider. At "Point" setting each point
effects a single mesh vertex, at "Surface" setting each point
influences
the entire surface.
Control 2:
Data force (Tiny / Medium / Large) controls the relative force of the
data and the surface. Surface interpolations are obtained by finding a
surface which both passes through the measured (or sketched) data
points
and simultaneously satisfies the surface constraints whcih control the
form/shape of the surface, e.g., smoothness. A setting of "Tiny" will
make the surface satisfy only its "internal" constraints, i.e., it
makes
the data force small relative to the internal surface forces. A setting
of "Large" will constrain the surface to pass through the data (at the
moment you must also make the third and fourth controls small for this
to occur but will be fixed soon). The internal constraints of the
surface are controlled via the third and fourth slider which enforce
different surface constraints (for details see below).
Surface Fitting Constraints :
Control 3:
Mean Field (Elastic / Flexible / Rigid) controls the allowable
deviation
of the mesh from its "original" shape. For example, if you load a plane
to deform, the original shape is defined by the collection of vertex
positions when you loaded the plane. At "Elastic" this constraint is
not
enforced. At "Rigid" the points are constrained to be close to their
original position making the surface more "Rigid" when data is
introduced.
Note: After deforming a shape you may update the "original" shape to be
the current collection of vertex positions by selecting "Freeze Current
Shape" this will set the "original" shape to the collection of current
vertex positions.
Control 4:
The Curvature Smoothing control is a floating point slider at the
moment. It constrains the allowable curvatures present in the
interpolation. If this force is large, the surface is constrained to be
smooth, i.e., the penalty requires that the curvature vary smoothly
over the interpolated surface.
Another useful button is the "Reset to Frozen Shape" which will reset
the vertex positions to the positions specified on the "original"
shape.
Which may be the loaded shape (if "Freeze Current Shape" function has
not been called) or the most recently "frozen" shape (if the "Freeze
Current Shape" function has been called).
Now that you have all of the controls for interpolation down, there is
the final wrinkle of actually controlling WHEN and WHERE the surface is
deforming.
Controlling WHEN the surface is
deforming:
This is done by clicking on the "Deform MRF" button. When this is
selected, some rather lengthy computations will begin followed by
interpolation iterations and the surface will begin to deform. You can
toggle the deformation "on/off" by re-selecting "Deform MRF".
IMPORTANT NOTE: EVEN WITH DEFORM
MRF "ON" NOTHING WILL HAPPEN UNLESS A PORTION OF THE SURFACE IS
SELECTED FOR DEFORMATION!
Controlling WHERE the surface is
deforming:
This is done by selecting some subset of the surface. There is a
variety of selection methods available. Surface Selection may be
performed from the "Surface Selection" tab for selecting large portions
or all of a given surface. For more detailed selections involving
smaller portions
of a surface, a manual selection interface is provided which is similar
to the sketching interface.
Surface Selection Tab:
Whole surfaces or discrete surface patches specified as groups of
triangles within the loaded file may be selected using the "Surface
Selection" tab.
Item 1 : The Triangle Group List
A list of surface patches corresponding to discrete triangle groups is
shown in a window with names "Group 0","Group 1","Group 2", etc.. The
number of groups listed will be the number of distinct triangle groups
in the loaded file and will vary depending on the type and internal
structure of the loaded OBJ or VRML file. One may select any subset of
the list by clicking on the group(s) of interest. To select more than
one group you must hold down the Cntrl key while clicking on the groups
of interest. Selected groups are then rendered as blue surfaces.
Item 2: Select All
This selects all the triangle groups (*shortly I will make this a
hot-key Cntrl-A*).
Item 3: De-Select All
This clears the selection to be nothing.
Item 4: Invert Selection
When a subset of a triangle group has been selected, this will "invert"
the selection by removing all of the selected vertices and subsequently
selecting all vertices which were not previously selected. For example,
say a triangle group has 5 vertices labeled {1,2,3,4,5}. We select
{1,2,3} then invert the selection. The result will be the selection
{4,5}.
Item 5: Select Connected Groups
This function will use the current selection as a seed to select all
vertices which are connected to any of the selected vertices. Taking
our example from above, say we select only vertex 3. Selecting this
function will change our selection from {3} to {1,2,3,4,5} since the
vertices {1,2,4,5} are connected to vertex {3} in the mesh.
External Device Interface
There is a generic interface which allows the user to interact with
objects in 3D. This interface is compatible with a number of different
devices which include the Polhemus ISOTRAK & FASTTRAK (and our
custom adaptation of this device for sculpting), Immersion
Corporation's Microscribe 3D articulated 3D arm, and a standard desktop
mouse. Since the latter of the 3 devices is by far the most common I
will describe it's interface analogies here and will leave the rest for
another day.
Desktop Mouse Interface
The desktop mouse typically has 3 buttons referred to as the left,
middle and right buttons. The ShaRP program reacts to the desktop mouse
in 2 modes. These modes are mutually exclusive and completely change
how the mouse is interpreted by the program. At the moment, there is no
visual feedback defining the active mouse mode (this to be fixed). We
will refer to the two modes as the "standard" mode and the "3D" mode.
Mouse Standard Mode
Typically the mouse is in standard mode, which allows the user to
select menu options from the top bar, select objects such as points,
meshes, and lighting from the left side of the screen and orient
objects in the scene.
Orienting objects in the scene
To orient objects in the scene, the user must select the object(s) on
the left portion of the screen. Selection of more than one object is
accomplished by holding Cntrl while clicking on the objects of
interest. Once, the objects have been selected the pose of the selected
objects is controlled by clicking a button and dragging it, i.e.,
moving the mouse while the button is depressed, either up/down or
left/right while in the 3D canvas (middle of the screen). The controls
are interpreted as follows:
Left Mouse Button : Rotates the object(s) around the centroid of the
first selected object. Movement left/right specifies
clockwise/counter-clockwise rotation about the Y axis (the verticle
axis). Movement up/down specifies clockwise/counter-clockwise rotation
about the X axis (the horizontal axis).
Middle Mouse Button : Translates/Zooms object(s) by changing their
depth (Z) position. Movement up/down specifies the object depth to be
farther/closer to you.
Right Mouse Button : Translates objects by changing their (X,Y)
position. Movement left/right specifies a positive or negative change
in the X position of the objects. Movement up/down specifies a positive
or negative change in the Y position of the objects.
Note that it can be easy to move objects off the screen, I would like
to make a function to send them back to their original position when
loaded but this is not present as of yet. Normally, the object may be
"found" by moving it farther away, i.e., translating along the Z axis.
3D Mode for the Desktop Mouse
The 3D Mode for the mouse is enabled/disabled by holding down/releasing
the Control key. One must ensure that the 3D canvas, i.e., the main
screen of the program is selected and that the mouse is positioned over
the 3D canvas when the Control button is pressed AND released.
NOTE: Sometimes drag operations will take the mouse outside of the
window. In this case the window will not register the release of the
Control key and you may get "stuck" in the 3D mode. To get out of this
mode, select the 3D canvas with the mouse and tap the Control key
several times.
When in 3D mode, the mouse controls a pink cone referred to as the *tool* present in the scene. The position of
this object is controlled in the same way that the object positions are
controlled as detailed in the section "Orienting Objects in the Scene."
For completeness this is:
Control+Left Mouse Button : The interpretation of this button depends
upon the selected interface mode (see following section on 3D interface
modes for details).
Control+Middle Mouse Button : Translates/Zooms the tool object by
changing its depth (Z) position. Movement up/down specifies the tool
depth to be farther/closer to you.
Control+Right Mouse Button : Translates the tool by changing its (X,Y)
position. Movement left/right specifies a positive or negative change
in the X position of the tool. Movement up/down specifies a positive or
negative change in the Y position of the tool.
NOTE: The Cntrl key must be held down the entire time during these
operations. When it is not held down, the mouse is in "standard" mode.
There is currently 3 possible modes. This document will describe two :
"Sketch Data This is detailed in the following sec
3D Interface Modes
There are 3 possible interface modes which use the tool position in
order to perform useful operations on objects in the 3D space. The
modes may be changed by selecting the Remesh / HCI tab. At the top of
this tab are the modes labeled :
1. Sketch Data
2. Add Attractor
3. Make Selections
The mode may be specified by clicking on one of these three labels. The
purpose and interpretation of each mode is as follows:
Sketch Data
This mode allows the user to lay off points in 3D space. If the MRF
model is enables (in Deformation Control) then the points are
interpreted as data which serves to deform the MRF surface. Data points
are placed at the tip of the cone tool and one may specify curves in
the XY plane by holding the Cntrl key down, clicking the left mouse
button over the 3D canvas, and dragging the mouse left/right and
up/down. This is generically referred to in this document as "3D
sketching."
Add Attractor
This allows one to place a single attractor (shown as a grey sphere)
which is used in conjunction with the growth model from the "Growth
Control" tab. *NOTE I will describe this later*.
Make Selections
This mode allows the user to select subsets of the surface. Surface
selection is an important tool for deformation, shape editing, and
shape growth and specifies the surface regions of interest for these
different operations.
When this mode is selected the tool changes
from a cone into a semi-transparent sphere. One may vary the position
of the sphere in the same way as that of the original tool and
additionally may change the radius of the sphere by varying the value
of the numeric slider (the slider could use some clarifying labels)
immediately below the interface modes in the "Remesh/HCI Mode" tab.
Regions are selected by moving the sphere to intersect the surface
patch of interest (using the same technique used to move a tool) and
subsequently clicking the left mouse button. When this occurs all
points within the transparent sphere of the tool will be selected. One
may select contiguous regions by holding the left mouse button down and
dragging mouse (and correspondingly the sphere) around on the canvas
which will continuously add points within the sphere to the list of
selected points.