[Newbies] Skewing Forms in Squeak V2

Matthias Berth matthias.berth at googlemail.com
Tue Jul 22 23:10:57 UTC 2008


So it comes down to this:

given a projective transformation T from a rectangle (your form) to a
quad Q (what you want to draw on screen), how can you express the same
transformation in terms of mapping a quad to a rectangle (what WarpBlt
needs)?

One possible plan is:

1) determine the transformation's parameters

2) take the bounding box of Q (a rectangle R) and transform it by the
inverse of T, giving you a quad Q'

3) use WarpBlt to transform pixels in Q' (should be a superset of your
form) to R

4) mask the result with your original quad Q, using pixel-by-pixel
operations on Forms

I think all you need in terms of mathematics for this is in
http://www.cs.cmu.edu/~ph/869/www/notes/proj/proj.pdf

Hope this helps, feel free to ask about the details,

Matthias



On Tue, Jul 22, 2008 at 9:31 PM, Iulian Wande Radu
<infinite.flow at gmail.com> wrote:
> Back to the question...
> Yes WarpBlt is available in v2, but I can't seem to be able to use it for
> this purpose, because it maps a quad to a rectangle (not a rectangle to a
> quad).
> There must be a way to do this...
>
>
> On Tue, Jul 22, 2008 at 3:27 PM, Brad Fuller <bradallenfuller at gmail.com>
> wrote:
>>
>> what is Squeak V2?
>>
>> On Tue, Jul 22, 2008 at 12:02 PM, Matthias Berth
>> <matthias.berth at googlemail.com> wrote:
>> > Hi,
>> >
>> > is WarpBlt available in Squeak V2?
>> >
>> > On Tue, Jul 22, 2008 at 7:53 PM, Iulian Wande Radu
>> > <infinite.flow at gmail.com> wrote:
>> >> Hi, I'd like to skew the graphics of a Form, is there an easy way to do
>> >> this
>> >> in v2 ?
>> >>
>> >> What I want is to take the rectangle from a normal form, transform it
>> >> into
>> >> an arbitrarily-defined quadrilateral, and then paint on the screen. I
>> >> saw
>> >> that WarpBlt does something like this.. but it maps a quadrilateral
>> >> section
>> >> of a form onto a rectangle.
>> >>
>> >>
>> >> _______________________________________________
>> >> Beginners mailing list
>> >> Beginners at lists.squeakfoundation.org
>> >> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>> >>
>> >>
>> > _______________________________________________
>> > Beginners mailing list
>> > Beginners at lists.squeakfoundation.org
>> > http://lists.squeakfoundation.org/mailman/listinfo/beginners
>> >
>>
>>
>>
>> --
>> Brad Fuller
>> www.bradfuller.com
>> _______________________________________________
>> Beginners mailing list
>> Beginners at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>


More information about the Beginners mailing list