Esempio n. 1
0
        public static List <Vector3d> TransformPoints(this Matrix4d matrix, List <Vector3d> a)
        {
            if (a == null || a.Count == 0)
            {
                return(null);
            }
            List <Vector3d> b = new List <Vector3d>();


            double[,] matrixdouble = matrix.ToDoubleArray();


            for (int i = 0; i < a.Count; i++)
            {
                Vector3d p1 = a[i];

                //Does not work with pointers...
                //this.LandmarkTransform.InternalTransformPoint(PointerUtils.GetIntPtr(p1), PointerUtils.GetIntPtr(p2));
                double[] pointFloat = new double[3] {
                    p1.X, p1.Y, p1.Z
                };
                double[] pointReturn = Matrix4dExtension.TransformPointdouble(pointFloat, matrixdouble);
                Vector3d v           = new Vector3d(pointReturn[0], pointReturn[1], pointReturn[2]);
                b.Add(v);
            }
            return(b);
        }