Affine Transform was [RE: Graphics Guru Challenge]
Alan Kay
Alan.Kay at squeakland.org
Fri Oct 19 17:59:11 UTC 2001
I seem to recall that Dan did do this. He is at OOPSLA but reading
mail, so perhaps he will recall what happened. Also, Balloon has a
superset of these transforms (i.e. the perspective transform is
nonlinear).
Cheers,
Alan
-----
At 9:11 AM -0700 10/19/01, Jim Benson wrote:
>I seem to remember several months ago [June 7] that affine transforms for
>use with WarpBlt were being discussed. The basic problem is to take a
>rectangle from one form and map it onto an arbitrary quadrangle. I wanted to
>use it for some perspective tricks.
>
>Dan Ingalls wrote:
>
>[
>First, the transformation from a quadrangle to a rectangle is an affine
>transformation. Once you know this, you can compute the affine
>transformation you desire, apply its inverse to the destination rectangle
>that WarpBlt requires, and you will then have the quadrilateral that you
>need to use on the source.
>]
>
>Searching through his disk, he found some code that Ted Kaehler wrote
>several years ago [which I've attached so you don't have to hunt it down].
>The attached code uses a method called #asQuad, which I assume maps to the
>modern day #corners [this could very well be the source of my problem].
>
>Being lazy, I filed in the code, and started fiddling with it.
>
>I thought this was a typical type of example that I would like to do:
>
>form := Form fromDisplay: ( 0 at 0 corner: 300 at 300 ).
>
> warp := (WarpBlt current toForm: Display)
> sourceForm: form ;
> cellSize: 2; "installs a new colormap if cellSize > 1"
> combinationRule: Form over.
> warp copyRect: ( 0 at 0 corner: 300 at 300 ) toQuad: { 128 at 455. 128 at 655. 280 at 620.
>280 at 443 }.
>
>
>However, when I tried this I received divide by zero errors. I'm not sure
>about the cellSize: statement, but it seemed important at the time.
>
>Rather than start digging through this, I wanted to check to see if anyone
>had any working code along this direction. The thread on the list seemed to
>die right before the good bit of a working example.
>
>Thanks,
>
>Jim
>
>
>Content-Type: application/octet-stream;
> name="AffineStuff-tk.cs.gz"
>Content-Disposition: attachment;
> filename="AffineStuff-tk.cs.gz"
>
>Attachment converted: Macintosh HD:AffineStuff-tk.cs.gz 1
>(????/----) (0003A029)
--
More information about the Squeak-dev
mailing list
|