Exemple #1
0
 public Vec Cross(Vec b)
 {
     return new Vec (
         Y*b.Z - Z*b.Y,
         Z*b.X - X*b.Z,
         X*b.Y - Y*b.X
     );
 }
Exemple #2
0
 public Vec NormalTo(Vec dest)
 {
     var v = dest - this;
     v.Normalize ();
     return v;
 }
Exemple #3
0
 public Ray(Vec orig, Vec dir)
 {
     Origin = orig;
     Direction = dir;
 }
Exemple #4
0
 public Prec Dot(Vec b)
 {
     return X * b.X + Y * b.Y + Z * b.Z;
 }
Exemple #5
0
 public Vec Mult(Vec b)
 {
     return new Vec (
         X * b.X,
         Y * b.Y,
         Z * b.Z
     );
 }
Exemple #6
0
 public override Vec GetNormal(Vec p)
 {
     return((p - Position).Norm);
 }
Exemple #7
0
 public void PutPixel(int x, int y, Vec color)
 {
     Buffer [(Height - 1 - y)*Width + x] = color;
 }
Exemple #8
0
 public abstract Vec GetNormal(Vec p);
Exemple #9
0
 public Sphere(Prec radius, Vec position, Vec emission, Vec color, MaterialType mt)
     : base(emission, color, mt)
 {
     Radius   = radius;
     Position = position;
 }
Exemple #10
0
 public SceneObject(Vec emission, Vec color, MaterialType mat)
 {
     Emission = emission;
     Color    = color;
     Material = mat;
 }
Exemple #11
0
 public override Vec GetNormal(Vec p)
 {
     return (p - Position).Norm;
 }
Exemple #12
0
 public Sphere(Prec radius, Vec position, Vec emission, Vec color, MaterialType mt)
     : base(emission, color, mt)
 {
     Radius = radius;
     Position = position;
 }
Exemple #13
0
 public abstract Vec GetNormal(Vec p);
Exemple #14
0
 public SceneObject(Vec emission, Vec color, MaterialType mat)
 {
     Emission = emission;
     Color = color;
     Material = mat;
 }