Example #1
0
        public void PatternWithObjectTransform()
        {
            var p = new TestPattern();
            var s = new Sphere(Scale(2f));
            var c = p.ColorAtEntity(s, Point(2f, 3f, 4f));

            Assert.That.VectorsAreEqual(c, new Color(1f, 1.5f, 2f));
        }
Example #2
0
        public void PatternWithBothTransformed()
        {
            var p = new TestPattern {
                Transform = Translation(.5f, 1f, 1.5f)
            };
            var s = new Sphere(Scale(2f));
            var c = p.ColorAtEntity(s, Point(2.5f, 3f, 3.5f));

            Assert.That.VectorsAreEqual(c, new Color(.75f, .5f, .25f));
        }