Пример #1
0
        public void NormalAt_should_calculate_the_normal_on_a_transformed_shape()
        {
            var shape  = new TestShape(Matrix4x4.CreateRotationZ(Math.PI / 5).Scale(1, 0.5, 1));
            var normal = shape.NormalAt(new Point(0, Math.Sqrt(2) / 2, -Math.Sqrt(2) / 2));

            normal.Should().Be(new Vector(0, 0.97014, -0.24254));
        }
Пример #2
0
        public void NormalAt_should_calculate_the_normal_ona_translated_shape()
        {
            var shape  = new TestShape(Matrix4x4.CreateTranslation(0, 1, 0));
            var normal = shape.NormalAt(new Point(0, 1.70711, -0.70711));

            normal.Should().Be(new Vector(0, 0.70711, -0.70711));
        }