Example #1
0
 public float4 mul( float4x4 a, float4 b )
 {
     return new float4(
         b.x * a.m[0,0] + b.y * a.m[0,1] + b.z * a.m[0,2] + b.w * a.m[0,3],
         b.x * a.m[1,0] + b.y * a.m[1,1] + b.z * a.m[1,2] + b.w * a.m[1,3],
         b.x * a.m[2,0] + b.y * a.m[2,1] + b.z * a.m[2,2] + b.w * a.m[2,3],
         b.x * a.m[3,0] + b.y * a.m[3,1] + b.z * a.m[3,2] + b.w * a.m[3,3]
         );
 }
Example #2
0
 public float4 mul( float4 a, float4x4 b )
 {
     return new float4(
         a.x * b.m[0,0] + a.y * b.m[1,0] + a.z * b.m[2,0] + a.w * b.m[3,0],
         a.x * b.m[0,1] + a.y * b.m[1,1] + a.z * b.m[2,1] + a.w * b.m[3,1],
         a.x * b.m[0,2] + a.y * b.m[1,2] + a.z * b.m[2,2] + a.w * b.m[3,2],
         a.x * b.m[0,3] + a.y * b.m[1,3] + a.z * b.m[2,3] + a.w * b.m[3,3]
         );
 }