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)); }
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)); }