コード例 #1
0
ファイル: Light.cs プロジェクト: tomswedlund/Renderer
 public Color L(Point point, out Point lightPos, out Normal lightDir)
 {
     Vector dir = this.Position - point;
     float dist = dir.Magnitude();
     lightDir = new Normal(dir);
     lightPos = this.Position;
     return (this.E / (dist * dist));
 }
コード例 #2
0
ファイル: Utils.cs プロジェクト: tomswedlund/Renderer
 public static Point Perturb(Point point, Normal toward)
 {
     return point + PERTURB * toward;
 }
コード例 #3
0
 public float f(Normal wi, Normal wo)
 {
     return (float)(1 / System.Math.PI);
 }
コード例 #4
0
ファイル: Ray.cs プロジェクト: tomswedlund/Renderer
 public Ray(Point origin, Normal direction)
 {
     this.Origin = origin;
     this.Direction = direction;
 }