Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

does anyone know about the beginGradientFill command in MX 1

Status
Not open for further replies.

mgason

Technical User
Feb 6, 2003
158
AU
Hi,
I posted this on a couple of other forums, zero replies.
so are you guys better ;-)
in mx there is the actionscript command beginGradientFill.
it requires a "matrix"
there are two types
one is
matrixType:box, x, y, w, h, r.
which is fairly obvious a box at x,y so wide so high with rotation.
the other is used like this
matrix = { a:200, b:0, c:0, d:0, e:200, f:0, g:200, h:200, i:1 };
the help says based on a 3 x 3 matrix
abc
def
ghi
can anyone explain how this matrix works, the help is, well not much help!

thanks mark
 
thanks for the answer. I found that article for myself after posting my question.
I do understand the box matrix method which will it seems do whatever you want, my curiosity still wonders how a 3x3 matrix works, which the article does not clarify. to quote ...

"There are two ways to define your matrix. The first is called a 3x 3 matrix. For the mathematically inclined this may be a familiar, but for the average user this way of defining size, location and rotation is far more confusing and is best left to those who wouldn't need a tutorial on its use. I'll skip this type of matrix for this tutorial,"

so is there a math genius out there who could explain that in laymens terms? In my search I have come across quite a few other people who would like to know the answer.

mark
 
[x,y,z]=[X,Y,Z]| a b c | matrix notation
| d e f |
| g h i |

x = X*a + Y*d + Z*g more familiar equations
y = X*b + Y*e + Z*h each point having a color, a ratio,
z = X*c + Y*f + Z*i and an alpha.

3x3 matrix colors(abc), alphas(def), ratios(ghi) (3 of each)

matrix can essentially be any number of dimensions but must be square i.e. 2x2 3x3 4x4 etc.

This is not a good explanation as I am relying on university math classes and that was many years ago.

Like much math the theory is less important than knowing how to apply it. (thats the engineer in me talking now).

I imagine that knowledge of the underlying equations is only important for someone wishing to produce a very specific effect.
 
I asked the same question myself and spent some time to answer the question to my satisfaction.
I made an interactive movie to help you and other people having trouble understanding the meaning of the matrix. I posted the movie in the following site.


Please visit the site and give me your comments.
 
Its an excellent demonstration and well worth the star i gave you.

I'm glad you just glossed over the math as that would have lost most of us and instead concentated on how to use this property.

Very well done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top