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 ); }
public Vec NormalTo(Vec dest) { var v = dest - this; v.Normalize (); return v; }
public Ray(Vec orig, Vec dir) { Origin = orig; Direction = dir; }
public Prec Dot(Vec b) { return X * b.X + Y * b.Y + Z * b.Z; }
public Vec Mult(Vec b) { return new Vec ( X * b.X, Y * b.Y, Z * b.Z ); }
public override Vec GetNormal(Vec p) { return((p - Position).Norm); }
public void PutPixel(int x, int y, Vec color) { Buffer [(Height - 1 - y)*Width + x] = color; }
public abstract Vec GetNormal(Vec p);
public Sphere(Prec radius, Vec position, Vec emission, Vec color, MaterialType mt) : base(emission, color, mt) { Radius = radius; Position = position; }
public SceneObject(Vec emission, Vec color, MaterialType mat) { Emission = emission; Color = color; Material = mat; }
public override Vec GetNormal(Vec p) { return (p - Position).Norm; }