Should work - i just did something similar: I recreated a cameraprojection matrix with values i took from a blender camera matrix. It worked as expected, but you have to be careful with the coordinate systems: left/right handed, y-up and z-up… also the matrices can be column or row major it seems… Took me a few tries to get the right sequence.
Rhinocommon Transform should already have all the methods you need.
My knowledge of matrices is also not the best, but you should use the rhino.transform class, as it has way more functions implemented and is basically a 4x4 matrix…
Transform t = new Transform(0);
t.M00 = x0.x;
t.M01 = x0.y;
etc..
double determinant = t.Determinant;
The transformation matrix is indeed a 4x4 matrix. The 3x3 sub-matrix defines the scaling and rotation matrix, and the 4th column’s first 3 entries the translation. The fourth row’s elements are all zero except the last one that is 1:
I trying to solve unify mesh windings problem by reading this stackoverflow post:
However It seems that it does not work for me or I simply do not know enough about matrices.
Could you please take a look at my code. The function below check if the winding is clockwise or not, but far from working outputting correct true and false statements:
private void RunScript(Mesh x, Point3d y, ref object A)
{
Looks to me like the check posted on Stack Exchange is flawed. The matrix represents a transformation to the local space of the basis defined by axes x, y, and z. Applying this transformation to the z axis will always result in (0,0,1), so, unless I’m missing something, this just seems like a very expensive way of checking if the z axis is pointing in the same direction as itself.
Yeah, this does not work. For me it looked super complex way for checking windings.
But after playing with matrices several times and seeing random results, I gave up.