public static PointCloud TransformPoints(this Matrix4d matrix, PointCloud a) { if (a == null || a.Vectors == null) { return(null); } PointCloud b = new PointCloud(); b.Vectors = new Vector3[a.Vectors.Length]; for (int i = 0; i < a.Vectors.Length; i++) { b.Vectors[i] = matrix.TransformVector(a.Vectors[i]); } if (a.Colors != null) { b.Colors = new Vector3[a.Colors.Length]; a.Colors.CopyTo(b.Colors, 0); } if (a.Indices != null) { b.Indices = new uint[a.Indices.Length]; a.Indices.CopyTo(b.Indices, 0); } return(b); }
public static void TransformVectorList(this Matrix4d matrix, List <Vector3> vectors) { if (vectors == null || vectors.Count == 0) { return; } for (int i = 0; i < vectors.Count; i++) { vectors[i] = matrix.TransformVector(vectors[i]); } }
public static void TransformVectors(this Matrix4d matrix, Vector3[] vectors) { if (vectors == null || vectors.Length == 0) { return; } for (int i = 0; i < vectors.Length; i++) { vectors[i] = matrix.TransformVector(vectors[i]); } }
public static void TransformPointCloud(this Matrix4d matrix, PointCloud pc) { if (pc == null || pc.Vectors.Length == 0) { return; } //List<Vector3d> b = new List<Vector3d>(); for (int i = 0; i < pc.Vectors.Length; i++) { pc.Vectors[i] = matrix.TransformVector(pc.Vectors[i]); } }