c# - How to emulate Vector3.TransformNormal -
i trying emulate vector3.transformnormal without directx library.
is able explain how function works, allow me recreate function?
so far know inputs , have seen description of does, don't know calculations.
public static vector3 transformnormal( vector3 source, matrix sourcematrix )
this should (didn't test)
public vector3 transformnormal(vector3 normal, matrix matrix) { return new vector3 { x = normal.x * matrix.m11 + normal.y * matrix.m21 + normal.z * matrix.m31, y = normal.x * matrix.m12 + normal.y * matrix.m22 + normal.z * matrix.m32, z = normal.x * matrix.m13 + normal.y * matrix.m23 + normal.z * matrix.m33 }; }
Comments
Post a Comment