Exemplo n.º 1
0
        public readonly V3d  Translation;       // cam 2 world was chosen, so that it can be easily read
                                                // while debugging

        public CameraExtrinsics(M33d cam2worldRotation, V3d cam2worldTranslation)
        {
            var zero = cam2worldRotation * cam2worldRotation.Transposed - M33d.Identity;

            if (zero.NormMax > 1e6)
            {
                throw new ArgumentException("supplied matrix is not a rotation");
            }
            if (cam2worldRotation.Determinant() < 0.0)
            {
                throw new ArgumentException("supplied rotation is improper (mirroring)");
            }
            Rotation    = cam2worldRotation;
            Translation = cam2worldTranslation;
        }