• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Will matrix be receiving new functions?!

I was wondering if matrix functions will be extended?
By this I mean adding for example

Code:
matrix_inverse(matrix);
to return the inverse of a given matrix
(it still requires some operations that could be much faster if implemented natively)
 

Mike

nobody important
GMC Elder
Yeah, would be a good one. file a suggestion if you like.

I will add a little caveat though.... Doing an inverse is an incredibly slow and time consuming thing, and while there are times you need it, a lot of the time you just mean transpose which is very quick.
So use with care (when it arrives).
 

FrostyCat

Member
Yeah, would be a good one. file a suggestion if you like.

I will add a little caveat though.... Doing an inverse is an incredibly slow and time consuming thing, and while there are times you need it, a lot of the time you just mean transpose which is very quick.
So use with care (when it arrives).
That only works when the matrix is orthogonal, which isn't always the case.
 

Mike

nobody important
GMC Elder
I'm aware of this. If your doing simple rotations and need an inverse - which is almost always the case for me, then I can use a transpose. Much of the time, this is what folk want/need/can use, not a full on inverse.
 
M

Multimagyar

Guest
I assume it will only work with matrix 4x4 as usual? Would not mind if it would work for R^(nxn) tho I already have my own script for that so not too much of a pain.
 
I assume it will only work with matrix 4x4 as usual? Would not mind if it would work for R^(nxn) tho I already have my own script for that so not too much of a pain.
In the documentation it says... you can make other sized matrix... I wonder if the methods are prepared to be fed a 9 size array... or a 25 size array.. and if they adjust to the matrix dimensions being ( sqrt(array_lenght) ) and still work.
 
M

Multimagyar

Guest
In the documentation it says... you can make other sized matrix... I wonder if the methods are prepared to be fed a 9 size array... or a 25 size array.. and if they adjust to the matrix dimensions being ( sqrt(array_lenght) ) and still work.
hmmm maybe I missread something at somepoint but if it is true I have quite a few pointless script... oh well at least I learned a few things about matrices.
 
M

Multimagyar

Guest
Just checked... and doesn't work! your scripts are no pointless :p though the documentation says:

" ...this matrix is a 4x4 matrix because it has four rows and four columns (other sized matrices can be constructed)."

http://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/matrices/index.html
Yeah Expected as much. I know the GMS1.4 doc said returns "array" when you multiply a matrices this one actually says it returns a matrix4x4 eeeeh. I guess a benefit of learning linear algebra is the fact that you know how to implement them. It's just sad they don't always give you a general idea what you can use them. In any case I looking forward to see more matrix function implementation in Game Maker.
 
Top