0
create custom matrix transform
Explorer
,
/t5/animate-discussions/create-custom-matrix-transform/td-p/767841
Jan 28, 2009
Jan 28, 2009
Copy link to clipboard
Copied
hi, i want to assign a transform matrix to an object, but i
want to assign the values myself (as in, no 'rotate, scale etc'),
but for example, set a matrix like
[1, 0
0, 1]
which if applied, would have no effect, but would be valid (actually not exactly that matrix, but you get the idea). i want to set the values of the matrix and the object should be affected by those values that i set by myself, no ´scale´, ´rotate´ or any predefined operations. how can i set my own matrix? tnx
[1, 0
0, 1]
which if applied, would have no effect, but would be valid (actually not exactly that matrix, but you get the idea). i want to set the values of the matrix and the object should be affected by those values that i set by myself, no ´scale´, ´rotate´ or any predefined operations. how can i set my own matrix? tnx
TOPICS
ActionScript
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guru
,
/t5/animate-discussions/create-custom-matrix-transform/m-p/767842#M16055
Jan 28, 2009
Jan 28, 2009
Copy link to clipboard
Copied
You can just set them in the constructor or via the a-d,
tx,ty properties:
var m:Matrix=new Matrix(.5,.3,-.6,1.5,-50,100)
trace(m)
m.a=4.5;
m.b=0;
m.c=0;
m.d=0.5;
m.tx=0;
m.ty=0;
trace(m)
//traces:
//(a=0.5, b=0.3, c=-0.6, d=1.5, tx=-50, ty=100)
//(a=4.5, b=0, c=0, d=0.5, tx=0, ty=0)
var m:Matrix=new Matrix(.5,.3,-.6,1.5,-50,100)
trace(m)
m.a=4.5;
m.b=0;
m.c=0;
m.d=0.5;
m.tx=0;
m.ty=0;
trace(m)
//traces:
//(a=0.5, b=0.3, c=-0.6, d=1.5, tx=-50, ty=100)
//(a=4.5, b=0, c=0, d=0.5, tx=0, ty=0)
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
VooDoo Chicken
AUTHOR
Explorer
,
/t5/animate-discussions/create-custom-matrix-transform/m-p/767843#M16056
Jan 30, 2009
Jan 30, 2009
Copy link to clipboard
Copied
hi, tnx, umm.. but that does not help much.
i mean, if i want a matrix to transform xy, a 2 column 2 rows would be enough (if there are more they would have identity fixed values), so if there are more than the four values x1y1, x1y2, x2y1, x2y2 values it means: the other values are affected by those values, or those extra values don't mean a thing. i need to assign 4 values, there are 6 values in a, b, c, d, tx, ty. how do i assign a 4 value custom transform matrix to an object?
(well, what i post this so i don't remain with the doubt, i found out i can not do what i was looking for this way but tnx)
i mean, if i want a matrix to transform xy, a 2 column 2 rows would be enough (if there are more they would have identity fixed values), so if there are more than the four values x1y1, x1y2, x2y1, x2y2 values it means: the other values are affected by those values, or those extra values don't mean a thing. i need to assign 4 values, there are 6 values in a, b, c, d, tx, ty. how do i assign a 4 value custom transform matrix to an object?
(well, what i post this so i don't remain with the doubt, i found out i can not do what i was looking for this way but tnx)
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/animate-discussions/create-custom-matrix-transform/m-p/767844#M16057
Jan 30, 2009
Jan 30, 2009
Copy link to clipboard
Copied
the flash matrix class can perform all 2d linear
transformations just like 2x2 mathematical matices can perform all
linear transformations in 2d space. but instead of adding and
multiplying by 2x2 matrices in mathematics to achieve those
transformations, in flash you multiply by a 3x3 matrix (with the
last row 0,0,1).
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
New Here
,
LATEST
/t5/animate-discussions/create-custom-matrix-transform/m-p/767845#M16058
Jul 03, 2009
Jul 03, 2009
Copy link to clipboard
Copied
Actually according to the ActionScript Language Reference the Matrix properties in Matrix notation look like this:
[ a b tx ]
[ c d ty ]
[ 0 0 1 ]
so if you want the equivalent of the 2x2 matrix you should just change the a,b,c,d properties.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

