public Ray(Vector3D origin, Vector3D direction, double intensity) { Origin = origin; double n = direction.Norm(); Direction = new Vector3D(direction.X/n, direction.Y/n, direction.Z/n); Intensity = intensity; }
public Ray(Vector3D origin, Vector3D direction, double intensity) { Origin = origin; double n = direction.Norm(); Direction = new Vector3D(direction.X / n, direction.Y / n, direction.Z / n); Intensity = intensity; }
public static double ReflectedRayAngleCos(Ray ray, Vector3D intersectionNormale) { double cos = Vector3D.Scalar(ray.Direction, intersectionNormale) / (ray.Direction.Norm() * intersectionNormale.Norm()); return(Math.Pow(-Math.Log(cos + 1), 2)); }
public static double ReflectedRayAngleCos(Ray ray, Vector3D intersectionNormale) { double cos = Vector3D.Scalar(ray.Direction, intersectionNormale)/(ray.Direction.Norm()*intersectionNormale.Norm()); return Math.Pow(-Math.Log(cos + 1), 2); }