This multiply point function simply multiplies up to a 4*4 matrix by a vector 3 or 4.
I am trying to replicate this function using only maths as I'm using shaders.
The maths itself is nothing spectacular, just the dot product of each column by each row to get the resulting transform.
My problem is that unity is returning my transform matrix as a 2*4,
and my vector to transform is a Vector4 (Vector 3 world position with an added 1 in the fourth component)
My conclusion being that this Unity function must do some other method before than standard matrix multiplication,any thoughts on this is welcomed.
This multiply point function simply multiplies up to a 4*4 matrix by a Vector3 or Vector4.
That's actually wrong, it only multiplies by a Vector3 - check the documentation.
Issue: to be helpful, Unity annoyingly "casts" between Vector2, Vector3, Vector4 (in different ways, that sometimes do and sometimes don't make sense).
If you're giving it a Vector4 as the argument, you are not actually getting what you think - it's "casting" it to a Vector3 in an attempt to be helpful.
I hope that's the problem here!
Just for the sake of any new readers googling here, in a=b.MultiplyPoint(c)
we have b (that's b, not a or c) is a FOUR (i.e. a "movement") and c is a THREE (position) and the result a is a THREE (position).