Exemple #1
0
	def test_translate_ray2(self):
		r = Ray(point(1, 2, 3), vector(0, 1, 0))
		m = xf_scale(2, 3, 4)
		r2 = r.transform(m)
		self.assertEqual(r2.origin, point(2, 6, 12))
		self.assertEqual(r2.direction, vector(0, 3, 0))
Exemple #2
0
	def test_translate_ray1(self):
		r = Ray(point(1, 2, 3), vector(0, 1, 0))
		m = xf_translate(3, 4, 5)
		r2 = r.transform(m)
		self.assertEqual(r2.origin, point(4, 6, 8))
		self.assertEqual(r2.direction, vector(0, 1, 0))