Image Processing Reference
In-Depth Information
More formally, the fluid system acts on a grid G of cells C i , j each containing an
energy vector E i , j , with a particular magnitude m and orientation
θ
,andwhere
0
rows . In order to define a “fluid profile” for the system,
two ratios are introduced that regulate that behavior of energy as it moves through
the cells. The first, the momentum ratio, or r 1 , defines how much energy moves for-
ward versus moving to the sides. The second, the directionality ratio, or r 2 ,defines
how much energy moves to the left versus moving to the right. A parameter, angu-
larity ,isdefinedas
<
i
<
columns and 0
<
j
<
. Additional
parameters influencing the fluid profile are the viscosity of the system, which acts as
a dampening factor defining the rate at which energy is removed from the system,
and the sensitivity which controls how much energy is added to the system through
some form of user interaction. New energy is added into the cells in a particular di-
rection using the multi-touch capabilities of the tablet device. The amount of energy
that is added in a particular touch depends upon the sensitivity parameter, which can
be adjusted during runtime. The magnitude of energy is also determined by how far
the current position of the touch is from its previous position. This difference also
determines the direction of the added energy. If there is no change in position, then
the energy is added in the last known direction. This vector of new energy is added
with any existing energy at the currently touched cell to update E i , j .
At each timestep t during the operation of the fluid system, the energy E in C i , j is
split into three separate streams: a forward stream, F , and two “orthogonal” streams,
L and R . Using the current fluid profile (the values for the parameters of momentum,
directionality ,and angularity ), and the current magnitude and orientation for each
cell, I define these three streams like so (in Equations 3.1 through 3.3):
φ [
0
, π )
, describing a rotation offset from
θ
r 1 m
θ
F
=
(13.1)
(
1
r 2
)(
1
r 1
)
m
L
=
(13.2)
θ + φ
r 2 (
1
r 1 )
m
R
=
(13.3)
θ φ
Figure 13.5 shows examples of how the current total energy in a cell is split into
three streams based on these parameters. Every cell in G thus contains three separate
streams of energy, F , L ,and R . These streams are used to define the flux of energy
moving from each cell into its neighboring cells. The calls to the S TREAM V ECTOR
procedure in the code listing in the Appendix also describe how energies are split
into different vectors based on r 1 and
φ
.
v
positioned at the center of C . This displaced cell D intersects with between 1 and
4 cells (the original cell C itself and up to three neighboring cells). The magnitude
of any energy vector is constrained to range between 0 and 1. When displacing a
cell, the magnitude is scaled by the length of a cell side. For instance, if the grid is
A “displaced” cell D
(
C
,
v
)
is a copy of a cell C
G that moves along a vector
 
Search WWH ::




Custom Search