Пример #1
0
Файл: Ray.cs Проект: tgy/CSharp
 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;
 }
Пример #2
0
 public virtual Vector3D GetNormal(Vector3D intersection)
 {
     return null;
 }
Пример #3
0
 public Camera(int width, int height, int depth)
 {
     Width = width;
     Height = height;
     D = new Vector3D(width / 2, height / 2, depth);
 }
Пример #4
0
 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);
 }
Пример #5
0
 public static double Scalar(Vector3D v1, Vector3D v2)
 {
     return v1.X*v2.X + v1.Y*v2.Y + v1.Z*v2.Z;
 }
Пример #6
0
 public Light(Vector3D position, int intensity)
 {
     Position = position;
     Intensity = intensity;
 }