示例#1
0
        public void ComputingNormalOnTransformedShape()
        {
            var s   = new shapes.TestShape(tf.Scaling(1, 0.5, 1) * tf.RotationZ(Math.PI / 5));
            var n   = s.NormalAt(pt.Point(0, Math.Sqrt(2) / 2, -Math.Sqrt(2) / 2));
            var exp = pt.Vector(0, 0.97014, -0.24254);

            CustomAssert.Equal(exp, n, 5);
        }
示例#2
0
        public void ComputingNormalOnTranslatedShape()
        {
            var s   = new shapes.TestShape(tf.Translation(0, 1, 0));
            var n   = s.NormalAt(pt.Point(0, 1.70711, -0.70711));
            var exp = pt.Vector(0, 0.70711, -0.70711);

            CustomAssert.Equal(exp, n, 5);
        }