public void A_smooth_triangle_uses_u_and_v_to_interpolate_the_normal()
        {
            var i = new Intersection(1, _tri, 0.45, 0.25);
            var n = _tri.NormalAt(Tuple.Point(0, 0, 0), i);

            n.Should().Be(Tuple.Vector(-0.5547, 0.83205, 0));
        }
        public void SmoothTriangleNormals()
        {
            Intersection i = new Intersection(1, tri, 0.45, 0.25);
            Tuple        n = tri.NormalAt(Tuple.Point(0, 0, 0), i);

            Assert.AreEqual(n, Tuple.Vector(-0.5547, 0.83205, 0));
        }
Beispiel #3
0
        public void ASmoothTriangleUsesUVToInterpolateTheNormal()
        {
            var i = new Intersection(1, tri, 0.45, 0.25);
            var n = tri.NormalAt(new Point(0, 0, 0), i);

            Assert.AreEqual(new Vector(-0.5547, 0.83205, 0), n);
        }
        public void When_computing_the_normal_vector_use_u_and_v_to_interpolate_the_normal()
        {
            var intersection = new Intersection(1, _triangle, 0.45, 0.25);
            var normal       = _triangle.NormalAt(Point.Zero, intersection);

            normal.Should().Be(new Vector(-0.5547, 0.83205, 0));
        }
Beispiel #5
0
        public void SmoothTriangleUsesUvToInterpolateTheNormal()
        {
            var i = new Intersection(1, tri, 0.45, 0.25);

            var n = tri.NormalAt(Helper.CreatePoint(0, 0, 0), i);

            Check.That(n).IsEqualTo(Helper.CreateVector(-0.5547, 0.83205, 0));
        }
Beispiel #6
0
        public void SmoothTriangle_ShouldUseUvToInterpolateTheNormal()
        {
            var p1  = new Point(0, 1, 0);
            var p2  = new Point(-1, 0, 0);
            var p3  = new Point(1, 0, 0);
            var n1  = new Vector(0, 1, 0);
            var n2  = new Vector(-1, 0, 0);
            var n3  = new Vector(1, 0, 0);
            var tri = new SmoothTriangle(p1, p2, p3, n1, n2, n3);
            var i   = new Intersection(1, tri, 0.45, 0.25);
            var n   = tri.NormalAt(new Point(0, 0, 0), i);

            Assert.Equal(new Vector(-0.5547, 0.83205, 0), n, VectorComparer);
        }