Пример #1
0
        public void NormalOnTranslatedShape()
        {
            var s = new TestShape(Translation(0f, 1f, 0f));
            var n = s.Normal(Point(0f, 1.70711f, -.70711f));

            Assert.That.VectorsAreEqual(n, Direction(0f, .70711f, -.70711f));
        }
Пример #2
0
        public void NormalOnTransformedShape()
        {
            var s   = new TestShape(Scale(1f, .5f, 1f) * RotationZ(MathF.PI / 5f));
            var val = MathF.Sqrt(2f) / 2f;
            var n   = s.Normal(Point(0f, val, -val));

            Assert.That.VectorsAreEqual(n, Direction(0f, .97014f, -.24254f));
        }