| http://swiss.csail.mit.edu/~jaffer/Geometry/Marbling-2 |
Serpentine Marbling |
http://langmuir.chem.utsunomiya-u.ac.jp/colloid/photo/echizen2
Although the distance function to a sinusoid curve can be computed, it
is easier to stroke tines vertically; and then add a horizontal
displacement proportional to the sin(degrees) of each point's
y-coordinate:
| Wh(x, y) = (x - 20 · sin(2.5 · y), y) |
[images are linked to PostScript files]
For a given point Z, if we apply a deformation followed immediately by the same deformation but with negative Z, the two motions are in opposite directions and leave the points where they started. F(-Z) is thus the inverse transform of F(Z). The inverse-composite-map is simply the composite-map functions in reverse order with negated Z:
| F -1 = F1-1 ° F2-1 ° · · · ° Fn-1 |
|---|
Where the previous algorithm took ink-circle coordinates and mapped
them to their destinations, we can as easily take coordinates in the
viewable area, transform them through the inverse-composite-map, and
identify which ink band they come from. Since my ink bands are
concentric circles, there is no need to explicitly enumerate them. I
just calculate the distance from the virtual ink center point, and
assign a color (from a palette sequence of 12) with modular
arithmetic.
This method eliminates restrictions on the number and thinness of ink
bands. Only the viewable area is rendered; one no longer needs to
experiment with circle increments and the mostly unseen outer
ink-circles.
But unlike the contoured images anti-aliased by GhostScript, assigning
the color to a pixel based just on the mapped coordinates' truncated
distance from the origin results in aliasing artifacts where multiple
bands squeeze through one pixel cell. Computing colors for
sub-sampled points would be slow; but the color-number's fractional
part can be used to interpolate between the colors of the two bands
whose border is closest.
The resulting image is perhaps too soft. Using an S-shaped function
to sharpen the distinction between the bands reaches a happy medium.
To the left is the circular marble rendered as nested contours.
To the right is the circular marble raster-rendered with the S-shaped
function.
The next chapter attempts more complicated
effects acheived by physical ink marbling.
|
I am a guest and not a member of the MIT Computer Science and Artificial Intelligence Laboratory.
My actions and comments do not reflect in any way on MIT. | ||
| Topological Computer Graphics | ||
| agj @ alum.mit.edu | Go Figure! | |