コード例 #1
0
        public void TestPatternApplyTransform()
        {
            var pattern = new TestPattern();

            pattern.Transform = Matrix.Translation(1, 2, 3);
            Assert.AreEqual(pattern.Transform, Matrix.Translation(1, 2, 3));
        }
コード例 #2
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));
        }
コード例 #3
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));
        }
コード例 #4
0
        public void TestPatternTest()
        {
            var pattern = new TestPattern();

            Assert.AreEqual(pattern.Transform, Matrix.Identity);
        }