public void TestDefaultPatternTransform() { var o = new Sphere(); var pattern = new Test_Pattern { Transform = Matrix4.Scaling(2, 2, 2) }; var c = pattern.ColorAtObject(o.WorldToObject(Tuple.Point(2, 3, 4))); Assert.AreEqual(new Color(1, 1.5, 2), c); }
public void TestDefaultObjectAndPatternTransform() { var o = new Sphere() { Transform = Matrix4.Scaling(2, 2, 2) }; var pattern = new Test_Pattern { Transform = Matrix4.Translation(0.5, 1, 1.5) }; var c = pattern.ColorAtObject(o.WorldToObject(Tuple.Point(2.5, 3, 3.5))); Assert.AreEqual(new Color(0.75, 0.5, 0.25), c); }