Exemple #1
0
        public bool IsShadowed(Light l, Tuple p)
        {
            Tuple v         = l.Position - p;
            float distance  = v.Magnitude();
            Tuple direction = v.Normalize();

            Ray r = new Ray(p, direction);
            List <Intersection> intersections = Intersection(r);

            RayTracer.Intersection h = RayTracer.Intersection.Hit(intersections);
            return((h != null) && (h.T < distance));
        }