예제 #1
0
        public Intersection FindClosestIntersectionWith(Ray ray)
        {
            Intersection closest = null;

            if (_left != null && _leftBounds.IntersectsRay(ray, 0, double.PositiveInfinity))
            {
                closest = _left.FindClosestIntersectionWith(ray);
            }

            if (_right != null && _rightBounds.IntersectsRay(ray, 0, (closest != null) ? closest.Distance : double.PositiveInfinity))
            {
                closest = Intersection.Closest(closest, _right.FindClosestIntersectionWith(ray));
            }

            return(closest);
        }
예제 #2
0
        public Color DetermineRayColor(Ray ray, IIntersectable scene)
        {
            var intersection = scene.FindClosestIntersectionWith(ray);

            return intersection == null ? Color.Black : intersection.Color;
        }
예제 #3
0
        public Color DetermineRayColor(Ray ray, IIntersectable scene)
        {
            var intersection = scene.FindClosestIntersectionWith(ray);

            return(intersection == null ? Color.Black : intersection.Color);
        }