public void StripedPatternZConst() { Pattern pattern = new StripedPattern(white, black); Assert.AreEqual(pattern.PatternAt(Tuple.Point(0, 0, 0)), white); Assert.AreEqual(pattern.PatternAt(Tuple.Point(0, 0, 1)), white); Assert.AreEqual(pattern.PatternAt(Tuple.Point(0, 0, 2)), white); }
public void StripePatternConstantZ() { Pattern black = new SolidPattern(Color.Black); Pattern white = new SolidPattern(Color.White); StripedPattern pattern = new StripedPattern(white, black); Assert.True(Color.White == pattern.PatternAt(new Point(0, 0, 0))); Assert.True(Color.White == pattern.PatternAt(new Point(0, 0, 1))); Assert.True(Color.White == pattern.PatternAt(new Point(0, 0, 2))); }
public void StripedPatternXChanges() { Pattern pattern = new StripedPattern(white, black); Assert.AreEqual(pattern.PatternAt(Tuple.Point(0, 0, 0)), white); Assert.AreEqual(pattern.PatternAt(Tuple.Point(0.9, 0, 0)), white); Assert.AreEqual(pattern.PatternAt(Tuple.Point(1, 0, 0)), black); Assert.AreEqual(pattern.PatternAt(Tuple.Point(-0.1, 0, 0)), black); Assert.AreEqual(pattern.PatternAt(Tuple.Point(-1, 0, 0)), black); Assert.AreEqual(pattern.PatternAt(Tuple.Point(-1.1, 0, 0)), white); }
public void StripePatternAlternatesX() { Pattern black = new SolidPattern(Color.Black); Pattern white = new SolidPattern(Color.White); StripedPattern pattern = new StripedPattern(white, black); Assert.True(Color.White == pattern.PatternAt(new Point(0, 0, 0))); Assert.True(Color.White == pattern.PatternAt(new Point(0.9f, 0, 0))); Assert.True(Color.Black == pattern.PatternAt(new Point(1, 0, 0))); Assert.True(Color.Black == pattern.PatternAt(new Point(-0.1f, 0, 0))); Assert.True(Color.Black == pattern.PatternAt(new Point(-1, 0, 0))); Assert.True(Color.White == pattern.PatternAt(new Point(-1.1f, 0, 0))); }