by dtristram · 1y ago · 0 comments
A very interesting process displaces the texture coordinates by advecting them along a flow field. Use any 2D vector field and apply displacement to each coordinate iteratively. Even inaccurate explicit methods give good results.
After the coordinates have been distorted to a far distance, the image becomes unrecognizable. A simple hack is to have a "restore" force applied to the coordinates, and they spring back to their original position, like flattening a piece of mirroring foil.
Just now I am using feedback along with these displacement effects. Very small displacements applied iteratively result in motion that looks quite a bit like fluid flow.
https://www.donhopkins.com/home/archive/news-tape/fun/melt/m...
%!
%
% Date: Tue, 26 Jul 88 21:25:03 EDT
% To: NeWS-makers@brillig.umd.edu
% Subject: NeWS meltdown
% From: eagle!icdoc!Ist!jh@ucbvax.Berkeley.EDU (Jeremy Huxtable)
%
% I thought it was time one of these appeared as well....
% NeWS screen meltdown
%
% Jeremy Huxtable
%
% Mon Jul 25 17:36:06 BST 1988
% The procedure "melt" implements the ever-popular screen meltdown feature.
/melt {
3 dict begin
/c framebuffer newcanvas def
framebuffer setcanvas clippath c reshapecanvas
clippath pathbbox /height exch def /width exch def pop pop
c /Transparent true put
c /Mapped true put
c setcanvas
1 1 1000 {
pop
random 800 mul
random 600 mul
random width 3 index sub mul
random height 2 index sub mul
4 2 roll
rectpath
0
random -5 mul
copyarea
pause
} for
framebuffer setcanvas
c /Mapped false put
/c null def
end
} def
melt
Here's Jeremy's original "Big Brother" eye.ps, that was the quintessential demo of round NeWS Eyeball windows:https://www.donhopkins.com/home/archive/news-tape/fun/eye/ey...
I tried naïvely using `ps2pdf` (Ghostscript), but got errors on both of them. I guess they're meant to be consumed by some other sort of system?
https://en.wikipedia.org/wiki/NeWS
For example, here's a heavily commented demo application called PizzaTool:
https://donhopkins.medium.com/the-story-of-sun-microsystems-...
Source code:
https://www.donhopkins.com/home/archive/NeWS/pizzatool.txt
It uses an iterated feedback pixel warping technique kind of like melt.ps, to spin the pizza rotationally, which melts the cheese and pizza toppings, instead of melting the screen by simply blitting random rectangles vertically like melt.ps -- note the randomization of the rotation to "dither" the rotation and smooth out the artifacts you'd get by always rotating it exactly the same amount:
% Spin the pizza around a bit.
%
/Spin { % - => -
gsave
/size self send % w h
2 div exch 2 div exch % w/2 h/2
2 copy translate
SpinAngle random add rotate
neg exch neg exch translate %
self imagecanvas
grestore
} def
It animates rotating a bitmap around its center again and again as fast as you "spin" it with the mouse, plus a little jitter, so the jaggies of the rotation (not anti-aliased, 8 bit pixels, nearest neighbor sampling) give it a "cooked" effect!It measures the size of the pizza canvas, translates to the center, rotates around the middle, then translates back to the corner of the image, then blits it with rotation and clipping to the round pizza window.
LGR: Kai's Power Goo – Classic 90s Funware for PC!