Esempio n. 1
0
File: Ray.cs Progetto: 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;
 }
Esempio n. 2
0
 public virtual Vector3D GetNormal(Vector3D intersection)
 {
     return null;
 }
Esempio n. 3
0
File: Camera.cs Progetto: tgy/CSharp
 public Camera(int width, int height, int depth)
 {
     Width = width;
     Height = height;
     D = new Vector3D(width / 2, height / 2, depth);
 }
Esempio n. 4
0
File: Scene.cs Progetto: tgy/CSharp
 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);
 }
Esempio n. 5
0
 public static double Scalar(Vector3D v1, Vector3D v2)
 {
     return v1.X*v2.X + v1.Y*v2.Y + v1.Z*v2.Z;
 }
Esempio n. 6
0
File: Light.cs Progetto: tgy/CSharp
 public Light(Vector3D position, int intensity)
 {
     Position = position;
     Intensity = intensity;
 }