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: Wed, 11 Oct 2006 09:50:54 +0200

On Tue, Oct 10, 2006 at 08:05:10PM +0100, Martin Guy wrote:
> s>   // Transform the coords.
> s>   float   x_scale = s_render_matrix.m_[0][0];
> s>   float   y_scale = s_render_matrix.m_[1][1];
> s>   float   x_offset = s_render_matrix.m_[0][2];
> s>   float   y_offset = s_render_matrix.m_[1][2]
> 
> Whoa, hang on, that code is correct.

I'm so proud to have you with us :D

[..]

> In code, the transformation would be:
> (x * scale_x + y * x_dep_y + 1 * translate_x) is your new x
> (x * y_dep_x + y * scale_x + 1 * translate_y) is your new y
                     ^^^^^^^ that's scale_y, right ?

[..]

> The values on the diagonal from top left to bottom right *do* scale
> the image if all the other values are 0, but so do the values at
> [0][1] and [1][0] as well as applying a rotation. I've called them
> x_dep_y and y_dep_x because they are how the output x coordinate
> depends on the input y coordinate and vice versa.

Ok, so taking  a *single* value out of the matrix is surely
wrong in all our cases, correct ?

I'm moving the matrix class in it's own files and adding documentation
(verbatim from your words, please review after commit).

After that I'd make the matrix itself private and make sure every uses are
trough exposed methods hiding the math complexity.
Finally, I'd like to provide a unit test for the matrix class, starting
with your examples, and possibly asking you to add a few more ? 

--strk;




reply via email to

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