public void TestPatternApplyTransform() { var pattern = new TestPattern(); pattern.Transform = Matrix.Translation(1, 2, 3); Assert.AreEqual(pattern.Transform, Matrix.Translation(1, 2, 3)); }
public void TestPatternPatternTransform() { var obj = new Sphere(); var pattern = new TestPattern(); pattern.Transform = Matrix.Scaling(2, 2, 2); var c = pattern.PatternAtObject(obj, new Point(2, 3, 4)); Assert.AreEqual(c, new Color(1, 1.5, 2)); }
public void TestPatternObjectPatternTransform() { var obj = new Sphere(); obj.Transform = Matrix.Scaling(2, 2, 2); var pattern = new TestPattern(); pattern.Transform = Matrix.Translation(0.5, 1, 1.5); var c = pattern.PatternAtObject(obj, new Point(2.5, 3, 3.5)); Assert.AreEqual(c, new Color(0.75, 0.5, 0.25)); }
public void TestPatternTest() { var pattern = new TestPattern(); Assert.AreEqual(pattern.Transform, Matrix.Identity); }