[comp.windows.news] smooth motion in Huxtable's eye.ps

fanty@icsia.berkeley.edu (Mark Fanty) (07/29/88)

NeWS animation which erases the old image before drawing the new one
often has an unpleasant flickering.  I liked Jeremy Huxtable's
recently posted eye.ps (Re: Big brother) so much I decided to attempt
a fix for the eyeballs.  My solution uses clipping to avoid erasing
any part of what will be the new eyeball.

The new painteyeball is

    /painteyeball { % x y colour =>
	setgray
	exch atan /angle exch def
	angle cos .2 mul
	angle sin .2 mul
	2 copy 2 copy
	Transform
	gsave
	0 0 .45 0 360 arc clip % avoid border
	% clip around new eye before erasing to avoid flicker
	.15 0 360 arc
	.8 0 360 arc eoclip backgroundcolor fillcanvas
        grestore
	.15 0 360 arc fill
    } def

Also, remove the line

                    EyeX EyeY 1 painteyeball

in the mouse event manager.


	Mark Fanty
	International Computer Science Institute
	1947 Center Street., Suite 600
	Berkeley, CA 94704

	(415) 643-7294
	fanty@icsi.berkeley.edu