gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re[2]: [Gnash-dev] does _height work??


From: strk
Subject: Re: Re[2]: [Gnash-dev] does _height work??
Date: Thu, 12 Apr 2007 18:09:18 +0200

On Wed, Oct 11, 2006 at 11:53:52AM +0100, Martin Guy wrote:

>   To be able to apply a transformation matrix, those two equations
> tell you everything you need to know.
>   Generating them is a bit harder, and I hope you'll never need to do
> this, but if you grok what follows, you will definitely have no more
> problems with them.

It seems it's time to *generate* matrices now.
This is to implement _rotation=x, _xscale=x, _yscale=x.
I'm not sure current implementation is fine nor I know if it makes 
any sense to separate rotation and scaling when it comes to setting those
values in the matrix.

See the matrix class of Gnash. I'm trying to add tests in this form:

        // WORKS
        m1.set_scale_rotation(1, 3, 0);
        check_equals(m1.get_x_scale(), 1);
        check_equals(m1.get_y_scale(), 3);
        check_equals(m1.get_rotation(), 0);

        // WORKS
        m1.set_scale_rotation(1, 1, 2);
        check_equals(m1.get_x_scale(), 1);
        check_equals(m1.get_y_scale(), 1);
        check_equals(m1.get_rotation(), 2);

        // FAILS !
        m.set_scale_rotation(2, 1, 2);
        check_equals(m1.get_x_scale(), 2); // get 1.23269
        check_equals(m1.get_y_scale(), 1); // get 1.8656
        check_equals(m1.get_rotation(), 2)

So, first of all, should I expect the above to work ?

--strk;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]