when using sprites... (that already have a defined origin point)
matrix_build is okay..
but when using surfaces (origin point is always [0,0])
matrix_build could have an advanced mode to help with that...
instead of :
which needs 4x matrix_build and 3x matrix_multiply... and keeping in mind that surfaces origin point is [0, 0] and by what I was told this will not change... I think this would be a good addition to the GML function set.
What do you think?!
NOTE:
I was going to ask for matrix2d functions as 99% of the gamemaker games are 2d
but I gave up as I don't think it will done.
matrix_build is okay..
but when using surfaces (origin point is always [0,0])
matrix_build could have an advanced mode to help with that...
instead of :
Code:
///matrix_build_adv(x, y, z, xpivot, ypivot, zpivot, rotationx, rotationy, rotationz, xscale, yscale, zscale)
// if there is rotation
if (argument6 || argument7 || argument8) {
var rotation = matrix_build(0, 0, 0, argument6, argument7, argument8, 1, 1, 1);
// if there is a pivot point
if (argument3 || argument4 || argument5) {
// create a -pivot point matrix
var i_origin = matrix_build(-argument3, -argument4, -argument5, 0, 0, 0, 1, 1, 1);
// create a pivot point matrix
var origin = matrix_build(argument3, argument4, argument5, 0, 0, 0, 1, 1, 1);
//multiply ((pivot inverse * rotation) * pivot)
rotation = matrix_multiply(matrix_multiply(i_origin, rotation), origin);
}
}
// build the position + scale matrix
var position = matrix_build(argument0, argument1, argument2, 0, 0, 0, argument9, argument10, argument11);
// apply the rotation to the previous matrix
transform = matrix_multiply(rotation, position);
What do you think?!
NOTE:
I was going to ask for matrix2d functions as 99% of the gamemaker games are 2d
but I gave up as I don't think it will done.
Last edited: