Example #1
0
        public Ray Transform(RtMatrix tranformation)
        {
            var newOrigin    = tranformation * Origin;
            var newDirection = tranformation * Direction;

            return(new Ray(newOrigin, newDirection));
        }
        public RtMatrix Inverse()
        {
            if (_inverseMatrix != RtMatrix.Identity)
            {
                return(_inverseMatrix);
            }

            _inverseMatrix = Matrix.Inverse();

            return(_inverseMatrix);
        }
Example #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);
        }
 public Transform(RtMatrix matrix)
 {
     Matrix = matrix;
 }
 public bool Equals(RtMatrix other)
 {
     return(Matrix.Equals(other));
 }