Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }