So far, I've had to manually pull out matrix.a,b,etc in order to use them for my own multiplication.
Is there a faster way than below?
var/matrix/m = src.transform
var/nx = m.a*x + m.b*y + m.c
var/ny = m.d*x + m.e*y + m.f
ID:1376673
Sep 14 2013, 10:55 am
|
|
Has anybody else worked out how to multiply x/y values against matrixes so we can use them for our own purposes?
So far, I've had to manually pull out matrix.a,b,etc in order to use them for my own multiplication. Is there a faster way than below? var/matrix/m = src.transform |
Sep 14 2013, 11:20 am
|
|
Can you just use the matrix.Multiply(matrix2 or number) proc...?
|
No, that returns a new matrix.
Nevermind, I figured it out. var/matrix/m = src.transform * matrix(1,0,x,0,1,y) Optionally, you could use Translate() on a matrix to get a new matrix with the correct x/y values too. |
In response to Flysbad
|
|
http://en.wikipedia.org/wiki/ Transformation_matrix#Examples_in_2D_graphics
You don't really have to worry about messing with the individual indices of the matrices. You can use the Translate, Turn, Scale, etc. procedures. Check the DM Reference? |