public static Matrix4 Compose( Vector3 translation, Vector3 scale, Quaternion orientation )
{
// Ordering:
// 1. Scale
// 2. Rotate
// 3. Translate
Matrix3 rot3x3, scale3x3;
rot3x3 = orientation.ToRotationMatrix();
scale3x3 = Matrix3.Zero;
scale3x3.m00 = scale.x;
scale3x3.m11 = scale.y;
scale3x3.m22 = scale.z;
// Set up final matrix with scale, rotation and translation
Matrix4 result = rot3x3 * scale3x3;
result.Translation = translation;
return result;
}