public static void RotateVertices(List <Vertex> vertexList, Matrix3d R)
        {
            List <Vector3d> listVectors = Vertices.ConvertToVector3dList(vertexList);

            MatrixUtilsOpenTK.RotateVectors(listVectors, R);
            Vertices.AssignNewVectorList(vertexList, listVectors);
        }
        public static void ScaleByVector(List <Vertex> vectorlList, Vertex v)
        {
            Matrix3d R = Matrix3d.Identity;

            R[0, 0] = v.Vector.X;
            R[1, 1] = v.Vector.Y;
            R[2, 2] = v.Vector.Z;

            MatrixUtilsOpenTK.RotateVertices(vectorlList, R);
        }
        public static void ScaleByFactor(List <Vertex> vectorlList, double scale)
        {
            Vector3d scaleVector = new Vector3d(scale, scale, scale);

            Matrix3d R = Matrix3d.Identity;

            R[0, 0] = scaleVector[0];
            R[1, 1] = scaleVector[1];
            R[2, 2] = scaleVector[2];

            MatrixUtilsOpenTK.RotateVertices(vectorlList, R);
        }
        public static void RotateVertices30Degrees(List <Vertex> vectorlList)
        {
            Matrix3d R = Matrix3d.Identity;

            //rotation 30 degrees
            R[0, 0] = 1F;
            R[1, 1] = R[2, 2] = 0.86603F;
            R[1, 2] = -0.5F;
            R[2, 1] = 0.5F;


            MatrixUtilsOpenTK.RotateVertices(vectorlList, R);
        }
예제 #5
0
        public static Matrix3d CalculateCorrelationMatrix(List <Vector3d> b, List <Vector3d> a)
        {
            //consists of elementx
            //axbx axby axbz
            //aybx ayby aybz
            //azbx azby azbz
            Matrix3d H = new Matrix3d();

            for (int i = 0; i < b.Count; i++)
            {
                //H[0, 0] += b[i].X * a[i].X;
                //H[1, 0] += b[i].X * a[i].Y;
                //H[2, 0] += b[i].X * a[i].Z;

                //H[0, 1] += b[i].Y * a[i].X;
                //H[1, 1] += b[i].Y * a[i].Y;
                //H[2, 1] += b[i].Y * a[i].Z;

                //H[0, 2] += b[i].Z * a[i].X;
                //H[1, 2] += b[i].Z * a[i].Y;
                //H[2, 2] += b[i].Z * a[i].Z;

                H[0, 0] += b[i].X * a[i].X;
                H[0, 1] += b[i].X * a[i].Y;
                H[0, 2] += b[i].X * a[i].Z;

                H[1, 0] += b[i].Y * a[i].X;
                H[1, 1] += b[i].Y * a[i].Y;
                H[1, 2] += b[i].Y * a[i].Z;

                H[2, 0] += b[i].Z * a[i].X;
                H[2, 1] += b[i].Z * a[i].Y;
                H[2, 2] += b[i].Z * a[i].Z;
            }
            H = MatrixUtilsOpenTK.MultiplyScalar3D(H, 1.0D / b.Count);
            return(H);
        }