Exemple #1
0
        // BSDF Public Methods
        public Bsdf(SurfaceInteraction si, double eta = 1.0)
        {
            Eta = eta;

            _ns = si.ShadingN;
            _ng = si.N;
            _ss = si.ShadingDpdu.Normalize();
            _ts = _ns.Cross(_ss);
        }
Exemple #2
0
        private static Ray3D ComputeIntersectionLine(ref Plane3D p1, ref Plane3D p2)
        {
            Ray3D ray = new Ray3D
            {
                Direction = (Vector3D)Normal3D.Cross(p1.Normal, p2.Normal)
            };
            float num = ray.Direction.LengthSquared();

            ray.Origin = (Point3D)(Vector3D.Cross((-p1.D * p2.Normal) + (p2.D * p1.Normal), ray.Direction) / num);
            return(ray);
        }