Matrix in System.drawing and Unity

public static bool CheckColisionLookAt(Vector3 t1a, Vector3 t1b, Vector3 t1c, Vector3 t2a, Vector3 t2b, Vector3 t2c)
     {//performs a transformation and checks if all points of the one triangle are under the other triangle after the transformation
       
         Matrix m = Matrix.CreateLookAt(t1a, t1b, t1c - t1a);
         t1a = Vector3.Transform(t1a, m);//  (0,     0,      0)
         if ( ZERRO < Math.Abs(t1a.X)|| ZERRO < Math.Abs(t1a.Y) || ZERRO < Math.Abs(t1a.Z))
             throw new Exception();
         t1b = Vector3.Transform(t1b, m);//  (0,     0,      maxZ)
         if (ZERRO < Math.Abs(t1a.X) || ZERRO < Math.Abs(t1a.Y))
             throw new Exception();
         t1c = Vector3.Transform(t1c, m);//  (0,     maxY,   someZ)
         if (ZERRO < Math.Abs(t1a.X))
             throw new Exception();
         t2a = Vector3.Transform(t2a, m);
         t2b = Vector3.Transform(t2b, m);
         t2c = Vector3.Transform(t2c, m);
         if (t2a.Y < 0 && t2b.Y < 0 && t2c.Y < 0)
             return false;
         return true;
     }

Can someone please modify this so it could work in Unity?

Where did that code come from? So you’re trying to transform two triangles… what kind of transform is it? Rotation? Translation? Scale?

Bumb.

I don’t think anyone is just going to rewrite your code for you. I suggest you read the links I gave you and learning how Unity works with Vectors and Transforms. You could also just look for a Unity based solution but you won’t learn anything by copy and pasting or having someone convert for you. Here’s one I found in about 10 seconds worth of searching:

http://lmgtfy.com/?q=unity3d+triangle+intersect