Пример #1
0
        public Ray Transform(RtMatrix tranformation)
        {
            var newOrigin    = tranformation * Origin;
            var newDirection = tranformation * Direction;

            return(new Ray(newOrigin, newDirection));
        }
Пример #2
0
        public RtMatrix Inverse()
        {
            if (_inverseMatrix != RtMatrix.Identity)
            {
                return(_inverseMatrix);
            }

            _inverseMatrix = Matrix.Inverse();

            return(_inverseMatrix);
        }
Пример #3
0
        public RtVector NormalToWorld(RtVector normal)
        {
            normal = RtMatrix.Transpose(Transform.Inverse()) * normal;
            normal = normal.Normalize();

            if (Parent != null)
            {
                normal = Parent.NormalToWorld(normal);
            }

            return(normal);
        }
Пример #4
0
 public Transform(RtMatrix matrix)
 {
     Matrix = matrix;
 }
Пример #5
0
 public bool Equals(RtMatrix other)
 {
     return(Matrix.Equals(other));
 }