Controller
Mapping
Control (a part of) a model through a simple separate model.
The essence of parametric modeling is the parameter---a variable
that influences other parts of the design. Understanding how
parameters affect a design is a crucial part of the modeling
process. Use this pattern when you want to interact with your
model in a clear and simple way, OR you want to convey to others
how you intend a model to be changed. *Remember, in the future
you may well be such another person if you have forgotten the
model structure!*
Isolating manipulations to a simple place away from the complex
detail of a model means that you can change the model more
easily. Using a logic for control that is different from the way
the model is defined means that you can use the most appropriate
interaction metaphor. Changing a collection of objects through
a single interface simplifies the interaction task.
As models grow, so does the need for a carefully considered set
of Controllers. In particularly complex models, you may well
design and implement a separate control panel that collects all
of the Controllers into a single place in the interface.
A Controller can do either or both of
the following: it can abstract an aspect of a model into a clear and
simple device or it can transform an aspect of a model into a different
form.
The key concept in a Controller is
separation. You build a separate model whose outputs link to the
inputs of your main model. The separate model is the
Controller. It should express, simply
and clearly, the way you intend to change the model.
Controllers can abstract or transform
and they can do both at the same time. An abstracting
Controller is a simple version of the
main model that suppresses unneeded detail. Parameters on lines
and curves are very simple case of a
Controller: they abstract a location
on a curve into a single number. The layout of controls on a
properly designed stovetop directly abstracts the layout of the
burners. In contrast, the vast majority of stovetop controls
fail to do this well.
A transforming Controller changes the
way you interact with a model. For example, polar coordinates
transform Cartesian coordinates \index{coordinates!Cartesian} into a different set of inputs.
A rotating knob on a stovetop transforms the amount of energy
delivered into an angle\index{angle}.
As one property changes in your model, one or more parts change;
you can connect these changing properties through a
Controller. Then, you can simply
change the Controller and see the
result in your model. Controllers are
thus independent---they have minimal connection to the model
they control and are easily connected and disconnected as
needed. This separation is the hallmark of a
Controller: every well-designed
Controller will have a symbolic model
that shows only one or a scant few links\index{link} between it and the
model it controls.
Vertical Line
Control the position of a
vertical line\index{line} on a curve\index{curve} with a
Controller.
Curves\index{curve} and
surfaces\index{surface} are complex
objects. Their parametric structure is typically hidden from
the interface -- a point\index{point} may move quickly in one part of a
curve and slowly in another as its parameter
changes. Further, curves and surfaces are usually part of a
design. There may be many other objects around them that
make it difficult to directly interact with their parametric
points. Controlling a point on a curve through a parametric
point on a line\index{line} addresses both of these issues. You can see
the relative parameterization of a curve point by examining
its controlling point. Further, the controlling point can be
in any position, near to or far from the model.
In this model, a single vertical line takes its position
from a parametric point on the curve $pOnCrv$.
The Controller is a line
and a parametric point on it. Making the parameter of the
$pOnCrv$ dependent on the point in the
Controller transfers control from
the curve to a straight line.
This is a very simple sample, but it demonstrates the
essential idea of separation of control and model.
Line Length
Change the length of a vertical line\index{line} with a slider.
This is a very simple sample of the
Controller, but one that
transforms a length in one direction to a length in
another. Start with a vertical line and a horizontal
Controller line. Connect the
length of the vertical line to the parameter of the point\index{point} on
the Controller line. Moving the
point in the Controller alters
the length of the vertical line.\vspace{12pt}
\renewcommand{\sampleNewPage}[0]{false}
Multiple Circles
Change the number of concentric circles with a slider.
The quantities controlled can be continuous (a real number)
or discrete (an integer or member of a sequence or set). In
this sample, a slider controls the numbers of concentric
circles. The parametic point on the slider connects to the
creation method of the circle\index{circle}. In this sample, the number of
the circles is determined by the parameter of the point on
the slider. As the parameter of the point\index{point} changes from
$0$ to $1$, the number of circles will
change from $m$ (in this case $m=0$)
to a predetermined number $n$. This
Controller requires a mapping\index{mapping}
between $0-1$ and $1-n$. The actual
math is simple: the number of circles for a given parameter
$t$ is $\backslash afFunc\{Floor\}\{t/(n-m)\}$. This
idea of mapping though is so general that it has its own
pattern: the Mapping pattern.
Controlling a discrete variable with a continuous slider can
be visually dissonant: the slider seems smooth yet the
result changes in steps. A typical solution is to mark the
slider at the locations at which the number of discrete
objects changes.
Cone Radii
Change the radii of a cone\index{cone} with a pair of concentric circles\index{circle}.
A single Controller can control multiple
aspects of a design. Of course, this poses a design problem in and of
itself. The Controller must visually cohere
with the object being controlled. In this sample, the aim is to
control the top and bottom radii of a cone. The Controller maps from
cocentric, coplanar circles to the cone's top and bottom surfaces. The Controller's
circles are controlled by points on their boundary. Two links from the
radii of the Controller's circles to the
cone radii connect the Controller to the
model. The
Controller circles provide a
visual reminder of the real objects being controlled: the
top and bottom of the cone.
Most of the time, the relative size of the circles when compared with
the cone suffices to distinguish the link between aspects of the
Controller and model. Even in this simple
case, such geometric coincidence may not suffice, for example, when
viewing in perspective or when the two radii are very close. Other
codes, such as colour (careful here!), text, line weight or graphic
labels, might be useful.
Equalizer
Adjust the height of multiple cylinders\index{cylinder} with a equalizer.
In this sample, the Controller takes
advantage of a roughly linear arrangement of objects in the model by
using the well-known design for a sound equalizer. The equalizer is a
row of sliders, each interactively independent of the others. This
design puts the controlled dimensions into visual proximity and thus
reveals their relative sizes, which might well be obscured in the
model due to location, size and perspective effects.
This Controller misses an
important aspect of the design of a physical sound equalizer. With
such a device an operator can use his or her entire hand to
simultaneously control several dimensions and to achieve a smooth
curve across dimensions. The computer mouse, with its relentless
one-thing-at-a-time design impoverishes the potential interactivity of
the Controller. Some of this could be
recovered by using a Reactor or
Selector pattern as part of the
Controller itself.
Parallel Lines
Adjust the length and position of a line parallel to a
reference line\index{line}.
In this sample, a single control parameter affects multiple model
parameters. It is the converse of the samples above, in which multiple independent
controls comprise the Controller. In the
model, a reference line establishes the direction and maximum length
of the result line. The
Controller comprises a single
line carrying a parametric point\index{point}. The direction and length
of the Controller line determines
the direction and length of a *guide* line that
orginates at one end of the reference line. A parametric
point on the guide line gets its parameter from the
Controller and is the start point
for the result. The result line gets its direction from the
reference and its length from the Controller.
If you move the Controller
parametric point, both the length of the result and its
distance from the reference change. If you move the
Controller line, the guideline
moves to remain parallel.
This Controller combines mutiple
controls (line length, direction and parametric distance) to
control multiple aspects of its result (distance, radial
position, and length). It also controls multiple aspects of
the result with a single control: both length and distance
of the result line are a function of parametric
distance. Sometimes, such *interdependence* is
intentional. More often though, it can confuse: the result
of the Controller becomes opaque with increasing complexity
in it relation to the model. Don Norman \cite{NORMAN1988}
is highly critical of such linked controls. Be warned: good
Controllers can be hard to write.
Right Triangle
Create different right triangles with the same base.
The right triangle\index{triangle} is a fascinating and useful geometric object. Some
of its instances have Pythagorean triples as dimensions; its
hypoteneuse is the diameter of its circumscribed circle; it combines
to form rectangles; and the sum of its two non-right angles is $90\; degrees$. Each of these could be the base
for a Controller design.
This Controller uses the last of the above
features, by using a half-circle to express the $180\; degree$ triangle angle sum. The base of the
half-circle gives the direction and length of the resulting triangle
base. Rays between the circle\index{circle} centre and two points on the circle
represent the direction of the sides of the triangle. If these two
points move freely on the half-circle, they specify an arbitrary
triangle. Presume that the half-circle has a $0-1$
parameter domain. If the parameter $t$ of one of these
points is constrained to the domain $0.0-0.5$ and the
other to the domain $t+0.5$, the generated triangle will
always be right-angled. Further, all right angled triangles can be
reached.
This Controller reveals that right-angled
triangles are two-parameter objects: the hypoteneuse length
and one angle suffice to uniquely determine the triangle up to
a rigid body motion. It does visually invert both the angle and
side when compared with the result. In reading across both
Controller and model, you encounter the
angles and lengths in reverse order. Some visual coherence has been
traded for geometric insight.
\begin{bodyNote}
\pbOneCol
{\input{\GCFigsPath/Patterns/ControllerRightTriangleDiagram0.tex}}
\end{bodyNote}
Hyperboloid of One Sheet
Abstract the geometry of a hyperboloid\index{hyperboloid} of one sheet to a plane\index{plane}.
A *hyperboloid of one sheet* is a ruled surface\index{surface!ruled}, that
is, it can be formed from a sequence of straight
lines\index{line}. Further, it is doubly ruled: two such sequences can
be combined into a lattice, making the form structurally
efficient. Conceptually, a hyperboloid can be defined by
twisting two parallel circles that have their centres on a
common normal line.
The hyperboloid's independent parameters are the radii of
the two circles and the twist of one circle\index{circle} relative to the
other. Starting with the
Controller from the
Cone sample, add a twist control to one circle.
Of course, the Controller has geometric limits, ranging from
but not including $-180$ to $180$
degrees. A twist of $180$ degrees turns the
hyperboloid into a cone. Two surfaces with twist parameter
$a$ and $-a$ are geometrically the
same but logically distinct. The difference is that the two
sets of generating lines are transposed. If one set carries
information distinct from the other, the resulting design
will differ as well.
\setlength{\storedWidth}{\currentWidth}
\setlength{\currentWidth}{\currentWidth*\real{0.8}}
\hfill
\hfill
\setlength{\currentWidth}{\storedWidth}
Azimuth Altitude
Control a direction by its *azimuth* and *altitude*.
The *azimuth* of a point\index{point} with respect to a
reference is the horizontal angle from a reference
direction. The *altitude* is the vertical angle\index{angle}
from the horizontal plane. As controls, azimuth
and altitude are independent: they specify
clearly separate changes to a point. Of course,
azimuth and altitude relate to two
of the dimensions of a *spherical* coordinate system
*(azimuth, zenith* and *radius*), with
$zenith\; =\; 90\; -\; altitude$.
An Azimuth Altitude Controller
comprises two concentric circles\index{circle} with equal radii: one
horizontal and one vertical. A parametric point on the
horizontal cricle determines both azimuth of
$t*360$ degrees and the vertical plane on which
the altitude circle lies. A parametric point on the altitude
circle determines the altitude. The Controller
is easily programmed to report the angles it produces.
In this sample, the model is simple: a pyramid with apex
controlled by a line of fixed length and direction given by
the Controller. Four points make the base of the
pyramid. The start point of the controlling line is the
intersection of the base diagonals. The direction is that of
the Azimuth Altitude Controller
and the distance from start to end is a predetermined value,
set outside of the Controller.
\setlength{\storedWidth}{\currentWidth}
\setlength{\currentWidth}{\currentWidth*\real{0.8}}
\hfill
\hfill
\setlength{\currentWidth}{\storedWidth}