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 virtual Vector3D GetNormal(Vector3D intersection) { return null; }
public Camera(int width, int height, int depth) { Width = width; Height = height; D = new Vector3D(width / 2, height / 2, depth); }
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 Scalar(Vector3D v1, Vector3D v2) { return v1.X*v2.X + v1.Y*v2.Y + v1.Z*v2.Z; }
public Light(Vector3D position, int intensity) { Position = position; Intensity = intensity; }