Hacker News new | ask | show | jobs
by DonHopkins 511 days ago
That was how Jeremy Huxtable (inventor of the original NeWS "Big Brother" Eyes that inspired XEyes) PostScript "melt" worked: choose a random rectangle, blit it with a random offset, lather, rinse, repeat, showing how by repeating a very digital square, sharp, angular effect, with a little randomness (dithering), you get a nice smooth organic effect -- this worked fine in black and white too of course -- it's just PostScript:

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...

1 comments

Are these animated, or somesuch?

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?

Oh sorry I didn't explain: they're interactive PostScript scripts for the NeWS window system, so they don't actually print, they animate on the screen! The "pause" yields the light weight PostScript thread and lets the rest of the window system tasks run, and NeWS had an object oriented programming system that was used to implement the user interface toolkit, window managements, interactive from ends, and even entire applications written in object oriented PostSCript. NeWS is long obsolete, but you can run it in a Sun emulator!

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.