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