public override Vector3 Value(float u, float v, Vector3 p)
        {
            var sines = (float)Math.Sin(10 * p.X) * (float)Math.Sin(10 * p.Y) * (float)Math.Sin(10 * p.Z);

            if (sines < 0)
            {
                return(odd.Value(u, v, p));
            }
            else
            {
                return(even.Value(u, v, p));
            }
        }
Esempio n. 2
0
 public override bool Scatter(Ray r_in, Hit_Record rec, out Vector3 attenuation, out Ray scattered)
 {
     scattered   = new Ray(rec.P, Helpers.Random_in_unit_sphere(), r_in.Time);
     attenuation = albedo.Value(rec.U, rec.V, rec.P);
     return(true);
 }