Exemple #1
0
        /**
         * arMatrixInv関数の代替品です。 destにsourceの逆行列を返します。
         *
         * @param dest
         * @param source
         * @throws NyARException
         */
        public static void matrixInv(NyARMat dest, NyARMat source)
        {
            NyARException.trap("未チェックのパス");
            dest.matrixDup(source);

            NyARException.trap("未チェックのパス");
            dest.matrixSelfInv();
        }
Exemple #2
0
        public NyARMat matrixAllocInv()
        {
            NyARException.trap("未チェックのパス");
            NyARMat result = matrixAllocDup();

            NyARException.trap("未チェックのパス");
            result.matrixSelfInv();
            return(result);
        }
        public NyARRotVector(NyARPerspectiveProjectionMatrix i_cmat)
        {
            NyARMat mat_a = new NyARMat(3, 3);
            double[][] a_array = mat_a.getArray();

            a_array[0][0] = i_cmat.m00;
            a_array[0][1] = i_cmat.m01;
            a_array[0][2] = i_cmat.m02;
            a_array[1][0] = i_cmat.m10;
            a_array[1][1] = i_cmat.m11;
            a_array[1][2] = i_cmat.m12;
            a_array[2][0] = i_cmat.m20;
            a_array[2][1] = i_cmat.m21;
            a_array[2][2] = i_cmat.m22;

            mat_a.matrixSelfInv();
            this._projection_mat_ref = i_cmat;
            this._inv_cpara_array_ref = mat_a.getArray();
            //GCない言語のときは、ここで配列の所有権委譲してね!
        }
Exemple #4
0
        public NyARRotVector(NyARPerspectiveProjectionMatrix i_cmat)
        {
            NyARMat mat_a = new NyARMat(3, 3);

            double[][] a_array = mat_a.getArray();

            a_array[0][0] = i_cmat.m00;
            a_array[0][1] = i_cmat.m01;
            a_array[0][2] = i_cmat.m02;
            a_array[1][0] = i_cmat.m10;
            a_array[1][1] = i_cmat.m11;
            a_array[1][2] = i_cmat.m12;
            a_array[2][0] = i_cmat.m20;
            a_array[2][1] = i_cmat.m21;
            a_array[2][2] = i_cmat.m22;

            mat_a.matrixSelfInv();
            this._projection_mat_ref  = i_cmat;
            this._inv_cpara_array_ref = mat_a.getArray();
            //GCない言語のときは、ここで配列の所有権委譲してね!
        }
        public void set2dVertex(NyARDoublePoint2d[] i_ref_vertex_2d, int i_number_of_vertex)
        {
            Debug.Assert(i_number_of_vertex == 4);
            double[] cx      = this._cx;
            double[] cy      = this._cy;
            double   cpara02 = this._projection_mat.m02;
            double   cpara12 = this._projection_mat.m12;
            NyARMat  mat_t   = this._mat_t;

            double[][] mata  = this._mat_a.getArray();
            double[][] matat = this._mat_at.getArray();
            for (int i = 0; i < 4; i++)
            {
                cx[i] = i_ref_vertex_2d[i].x;
                cy[i] = i_ref_vertex_2d[i].y;
                int x2 = i * 2;
                mata[x2][2]     = matat[2][x2] = cpara02 - i_ref_vertex_2d[i].x;     // mat_a->m[j*6+2]=mat_b->m[num*4+j*2]=cpara[0][2]-pos2d[j][0];
                mata[x2 + 1][2] = matat[2][x2 + 1] = cpara12 - i_ref_vertex_2d[i].y; // mat_a->m[j*6+5]=mat_b->m[num*4+j*2+1]=cpara[1][2]-pos2d[j][1];
            }
            //T(3x3行列)の作成
            mat_t.matrixMul(this._mat_at, this._mat_a);
            mat_t.matrixSelfInv();
            return;
        }
Exemple #6
0
        /**
         * arMatrixInv関数の代替品です。 destにsourceの逆行列を返します。
         * 
         * @param dest
         * @param source
         * @throws NyARException
         */
        public static void matrixInv(NyARMat dest, NyARMat source)
        {
            NyARException.trap("未チェックのパス");
            dest.matrixDup(source);

            NyARException.trap("未チェックのパス");
            dest.matrixSelfInv();
        }