377 |
so as to make the movement of $A$ look natural. |
so as to make the movement of $A$ look natural. |
378 |
|
|
379 |
There should be some maximum radius $r$ of distortion such that |
There should be some maximum radius $r$ of distortion such that |
380 |
whether a point $y$ is in $B$ depends only on the set $A \cap B(y, r)$, |
whether a point $y$ is in $B$ depends only on the set $A \cap B(q, r)$, |
381 |
where $B(y, r)$ is a ball of radius $r$ centered at $y$. |
where $B(q, r)$ is a ball of radius $r$ centered at $q \in \mathbf{R}^2$. |
382 |
$A \cap B(y, r) = \emptyset$ should imply $y \notin B$ and |
$A \cap B(q, r) = \emptyset$ should imply $q \notin B$ and |
383 |
$A \cap B(y, r) = B(y,r)$ should imply $y \in B$. |
$A \cap B(q, r) = B(y,r)$ should imply $q \in B$. |
384 |
Additionally, the mapping from $A$'s to $B$'s should be continuous |
Additionally, the mapping from $A$'s to $B$'s should be continuous |
385 |
so that slow movement of $A$ results into smooth ``rippling'' in $B$. |
so that slow movement of $A$ results into smooth ``rippling'' in $B$. |
386 |
Furthermore, the rippling should not be too fast. |
Furthermore, the rippling should not be too fast. |
399 |
$R \subset (\mathbf{R}^2)^2$ that identifies the points of $A$ |
$R \subset (\mathbf{R}^2)^2$ that identifies the points of $A$ |
400 |
with points in $B$: |
with points in $B$: |
401 |
\[ |
\[ |
402 |
B = \{\, y \mid \exists x \in A: x R y \,\}. |
B = \{\, q \mid \exists p \in A: p R q \,\}. |
403 |
\] |
\] |
404 |
If $\Vert x - y\Vert \le r$ for all $x R y$, the maximum distortion requirement |
If $\Vert p - q\Vert \le r$ for all $p R q$, the maximum distortion requirement |
405 |
is satisfied. |
is satisfied. |
406 |
|
|
407 |
If $R$ is a continuous function, i.e., $x R y \Leftrightarrow y = G(x)$, |
If $R$ is a continuous function, i.e., $p R q \Leftrightarrow p = G(q)$, |
408 |
the irregular shapes will be connected (if the original shape is connected), |
the irregular shapes will be connected (if the original shape is connected), |
409 |
but some parts of original |
but some parts of original |
410 |
shape may map to overlapping parts in the irregular shape. |
shape may map to overlapping parts in the irregular shape. |
412 |
image of its border. |
image of its border. |
413 |
|
|
414 |
If $R$ is a continuous function in the inverse direction, i.e., |
If $R$ is a continuous function in the inverse direction, i.e., |
415 |
$x R y \Leftrightarrow F(y) = x$, |
$p R q \Leftrightarrow F(q) = p$, |
416 |
there will be no overlapping. |
there will be no overlapping. |
417 |
Specifically, the edge of $A$ will map to the edge of $B$. |
Specifically, the edge of $A$ will map to the edge of $B$. |
418 |
However, the irregular shape may be scattered, if many points |
However, the irregular shape may be scattered, if many points |
424 |
texture shading hardware: |
texture shading hardware: |
425 |
the image of the undistorted shape can be stored in a texture and accessed |
the image of the undistorted shape can be stored in a texture and accessed |
426 |
with texture coordinates read from (or offset by) another texture storing the |
with texture coordinates read from (or offset by) another texture storing the |
427 |
inverse function (or the offset $F(y) - y$). |
inverse function (or the offset $F(q) - q$). |
428 |
This is called a dependent (or offset) texture access. |
This is called a dependent (or offset) texture access. |
429 |
|
|
430 |
The forward function cannot be efficiently implemented on fragment level, |
The forward function cannot be efficiently implemented on fragment level, |
519 |
|
|
520 |
These two algorithms correspond to one-dimensional displacement |
These two algorithms correspond to one-dimensional displacement |
521 |
and offset distortions, where the one dimension is in the normal direction. |
and offset distortions, where the one dimension is in the normal direction. |
522 |
|
That corresponding function and inverse function are |
523 |
|
\begin{eqnarray} |
524 |
|
G_n(p) &=& p + r n (2f(p) - 1), \\ |
525 |
|
F_n(q) &=& q - r n (2f(q) - 1), |
526 |
|
\end{eqnarray} |
527 |
|
where $n$ is the unit normal and $r$ the distortion radius. |
528 |
|
|
529 |
Although these algorithms seem different and produce different results, there is |
Although these algorithms seem different and produce different results, there is |
530 |
actually a general formulation which yields to a visual explanation. |
actually a general formulation which yields to a visual explanation. |
870 |
where ${\bf d}$ is the unit normal |
where ${\bf d}$ is the unit normal |
871 |
of the envelope. The dot product automatically inverts the |
of the envelope. The dot product automatically inverts the |
872 |
function for a 180 degree rotation. |
function for a 180 degree rotation. |
873 |
|
XXX: equivalent to drawing each envelope section by real 2D-offsetting |
874 |
|
of a half-plane |
875 |
|
|
876 |
The texture shader version can directly use the vector valued ripple function. |
The texture shader version can directly use the vector valued ripple function. |
877 |
It can also be used with the |
It can also be used with the |