コード例 #1
0
        public void initInverseVectorsOPENTK()
        {
            Scientrace.Vector x = this.u;
            Scientrace.Vector y = this.v;
            Scientrace.Vector z = this.w;

            OpenTK.Matrix4d m = new OpenTK.Matrix4d(
                x.x, x.y, x.z, 0,
                y.x, y.y, y.z, 0,
                z.x, z.y, z.z, 0,
                0, 0, 0, 1);

            m.Invert();
            this.ui = new Scientrace.Vector(m.M11, m.M12, m.M13);
            this.vi = new Scientrace.Vector(m.M21, m.M22, m.M23);
            this.wi = new Scientrace.Vector(m.M31, m.M32, m.M33);
        }
コード例 #2
0
        public static void TransformNormal(ref Vector3d norm, ref Matrix4d mat, out Vector3d result)
        {
            Matrix4d invMat = Matrix4d.Invert(mat);

            Vector3d.TransformNormalInverse(ref norm, ref invMat, out result);
        }
コード例 #3
0
 public static Vector3d TransformNormal(Vector3d norm, Matrix4d mat)
 {
     mat.Invert();
     return(Vector3d.TransformNormalInverse(norm, mat));
 }
コード例 #4
0
ファイル: VectorTransform.cs プロジェクト: JoepBC/scientrace
        public void initInverseVectorsOPENTK()
        {
            Scientrace.Vector x = this.u;
            Scientrace.Vector y = this.v;
            Scientrace.Vector z = this.w;

            OpenTK.Matrix4d m = new OpenTK.Matrix4d(
                x.x, x.y, x.z, 0,
                y.x, y.y, y.z, 0,
                z.x, z.y, z.z, 0,
                0, 0, 0, 1);

            m.Invert();
            this.ui = new Scientrace.Vector(m.M11, m.M12, m.M13);
            this.vi = new Scientrace.Vector(m.M21, m.M22, m.M23);
            this.wi = new Scientrace.Vector(m.M31, m.M32, m.M33);
        }