public void testCameraFollowsObject() {

		// object at the origin of the global axes

		double[][] object = HoneyBee.createTransformForOrigin();

		double[][] camera = BeeColony
				.cameraFollowsObject(object, BEHIND, ABOVE);

		double[] actualTranslation = HoneyBee
				.getTranslationFromTransform(camera);

		double[] expectedTranslation = new double[] { 0.0, -3.0, 1.0 };

		boolean passed = HoneyBee.assertVectorsEqual(expectedTranslation,
				actualTranslation, SCALE);

		assertTrue(passed);

		double[][] actualRotation = HoneyBee.getRotationFromTransform(camera);

		double[][] expectedRotation = new double[][] {
				new double[] { 1.0, 0.0, -0.0 },
				new double[] { 0.0, 0.316228151321, 0.948683142662 },
				new double[] { 0.0, -0.948683142662, 0.316228151321 } };

		passed = HoneyBee.assertMatricesEqual(expectedRotation, actualRotation,
				SCALE);

		assertTrue(passed);

		// perform global rotation of 0,0,20

		object = HoneyBee.rotateAroundGlobalAxes(object, 0, 0, 20);

		camera = BeeColony.cameraFollowsObject(object, BEHIND, ABOVE);

		actualTranslation = HoneyBee.getTranslationFromTransform(camera);

		expectedTranslation = new double[] { 1.02606034279, -2.8190779686, 1.0 };

		passed = HoneyBee.assertVectorsEqual(expectedTranslation,
				actualTranslation, SCALE);

		assertTrue(passed);

		actualRotation = HoneyBee.getRotationFromTransform(camera);

		expectedRotation = new double[][] {
				new double[] { 0.939692616463, 0.342020094395, 0.0 },
				new double[] { -0.108156383038, 0.297157257795, 0.948683142662 },
				new double[] { 0.32446873188, -0.891470611095, 0.316228151321 } };

		passed = HoneyBee.assertMatricesEqual(expectedRotation, actualRotation,
				SCALE);

		assertTrue(passed);

		// perform local translation of 0,3,0

		object = HoneyBee.translateAlongLocalAxes(object, 0, 3, 0);

		camera = BeeColony.cameraFollowsObject(object, BEHIND, ABOVE);

		actualTranslation = HoneyBee.getTranslationFromTransform(camera);

		expectedTranslation = new double[] { -4.60703063254e-07,
				-3.93938734078e-07, 1.0 };

		passed = HoneyBee.assertVectorsEqual(expectedTranslation,
				actualTranslation, SCALE);

		assertTrue(passed);

		actualRotation = HoneyBee.getRotationFromTransform(camera);

		expectedRotation = new double[][] {
				new double[] { 0.939692616463, 0.342020094395, 0.0 },
				new double[] { -0.108156383038, 0.297157257795, 0.948683142662 },
				new double[] { 0.32446873188, -0.891470611095, 0.316228151321 } };

		passed = HoneyBee.assertMatricesEqual(expectedRotation, actualRotation,
				SCALE);

		assertTrue(passed);

		// perform local rotation of 0,10,0

		object = HoneyBee.rotateAroundLocalAxes(object, 0, 10, 0);

		camera = BeeColony.cameraFollowsObject(object, BEHIND, ABOVE);

		actualTranslation = HoneyBee.getTranslationFromTransform(camera);

		expectedTranslation = new double[] { -4.60703063254e-07,
				-3.93938734078e-07, 1.0 };

		passed = HoneyBee.assertVectorsEqual(expectedTranslation,
				actualTranslation, SCALE);

		assertTrue(passed);

		actualRotation = HoneyBee.getRotationFromTransform(camera);

		expectedRotation = new double[][] {
				new double[] { 0.939692616463, 0.342020094395, 0.0 },
				new double[] { -0.108156383038, 0.297157257795, 0.948683142662 },
				new double[] { 0.32446873188, -0.891470611095, 0.316228151321 } };

		passed = HoneyBee.assertMatricesEqual(expectedRotation, actualRotation,
				SCALE);

		assertTrue(passed);

		// perform local translation of 0.5,0,0

		object = HoneyBee.translateAlongLocalAxes(object, 0.5, 0, 0);

		camera = BeeColony.cameraFollowsObject(object, BEHIND, ABOVE);

		actualTranslation = HoneyBee.getTranslationFromTransform(camera);

		expectedTranslation = new double[] { 0.462707787752, 0.168411776423,
				0.913175880909 };

		passed = HoneyBee.assertVectorsEqual(expectedTranslation,
				actualTranslation, SCALE);

		assertTrue(passed);

		actualRotation = HoneyBee.getRotationFromTransform(camera);

		expectedRotation = new double[][] {
				new double[] { 0.939692616463, 0.342020094395, 0.0 },
				new double[] { -0.108156383038, 0.297157257795, 0.948683142662 },
				new double[] { 0.32446873188, -0.891470611095, 0.316228151321 } };

		passed = HoneyBee.assertMatricesEqual(expectedRotation, actualRotation,
				SCALE);

		assertTrue(passed);

		// perform global rotation of 0,0,-32.4

		object = HoneyBee.rotateAroundGlobalAxes(object, 0, 0, -32.4);

		camera = BeeColony.cameraFollowsObject(object, BEHIND, ABOVE);

		actualTranslation = HoneyBee.getTranslationFromTransform(camera);

		expectedTranslation = new double[] { -1.20755887032, 0.0574729442596,
				0.913175821304 };

		passed = HoneyBee.assertVectorsEqual(expectedTranslation,
				actualTranslation, SCALE);

		assertTrue(passed);

		actualRotation = HoneyBee.getRotationFromTransform(camera);

		expectedRotation = new double[][] {
				new double[] { 0.976672232151, -0.214735463262,
						-1.65507589855e-08 },
				new double[] { 0.0679054111242, 0.308851242065, 0.948683142662 },
				new double[] { -0.203715905547, -0.926552534103, 0.316228151321 } };

		passed = HoneyBee.assertMatricesEqual(expectedRotation, actualRotation,
				SCALE);

		assertTrue(passed);

		// perform local rotation of 13.7,0,0

		object = HoneyBee.rotateAroundLocalAxes(object, 13.7, 0, 0);

		camera = BeeColony.cameraFollowsObject(object, BEHIND, ABOVE);

		actualTranslation = HoneyBee.getTranslationFromTransform(camera);

		expectedTranslation = new double[] { -1.20755887032, 0.0574729442596,
				0.913175821304 };

		passed = HoneyBee.assertVectorsEqual(expectedTranslation,
				actualTranslation, SCALE);

		assertTrue(passed);

		actualRotation = HoneyBee.getRotationFromTransform(camera);

		expectedRotation = new double[][] {
				new double[] { 0.976672232151, -0.214735463262,
						-1.65507589855e-08 },
				new double[] { 0.0679054111242, 0.308851242065, 0.948683142662 },
				new double[] { -0.203715905547, -0.926552534103, 0.316228151321 } };

		passed = HoneyBee.assertMatricesEqual(expectedRotation, actualRotation,
				SCALE);

		assertTrue(passed);

		// perform local translation of 0,0,1.9

		object = HoneyBee.translateAlongLocalAxes(object, 0, 0, 1.9);

		camera = BeeColony.cameraFollowsObject(object, BEHIND, ABOVE);

		actualTranslation = HoneyBee.getTranslationFromTransform(camera);

		expectedTranslation = new double[] { -0.9911211133, -0.450854361057,
				2.73107528687 };

		passed = HoneyBee.assertVectorsEqual(expectedTranslation,
				actualTranslation, SCALE);

		assertTrue(passed);

		actualRotation = HoneyBee.getRotationFromTransform(camera);

		expectedRotation = new double[][] {
				new double[] { 0.976672232151, -0.214735463262,
						-1.65507589855e-08 },
				new double[] { 0.0679054111242, 0.308851242065, 0.948683142662 },
				new double[] { -0.203715905547, -0.926552534103, 0.316228151321 } };

		passed = HoneyBee.assertMatricesEqual(expectedRotation, actualRotation,
				SCALE);

		assertTrue(passed);

		// perform local translation of -2.3,0,0

		object = HoneyBee.translateAlongLocalAxes(object, -2.3, 0, 0);

		camera = BeeColony.cameraFollowsObject(object, BEHIND, ABOVE);

		actualTranslation = HoneyBee.getTranslationFromTransform(camera);

		expectedTranslation = new double[] { -3.20334076881, 0.0355333723128,
				3.13046622276 };

		passed = HoneyBee.assertVectorsEqual(expectedTranslation,
				actualTranslation, SCALE);

		assertTrue(passed);

		actualRotation = HoneyBee.getRotationFromTransform(camera);

		expectedRotation = new double[][] {
				new double[] { 0.976672232151, -0.214735463262,
						-1.65507589855e-08 },
				new double[] { 0.0679054111242, 0.308851242065, 0.948683142662 },
				new double[] { -0.203715905547, -0.926552534103, 0.316228151321 } };

		passed = HoneyBee.assertMatricesEqual(expectedRotation, actualRotation,
				SCALE);

		assertTrue(passed);

		// perform global translation of 1.2,2.3,0

		object = HoneyBee.translateAlongGlobalAxes(object, 1.2, 2.3, 0);

		camera = BeeColony.cameraFollowsObject(object, BEHIND, ABOVE);

		actualTranslation = HoneyBee.getTranslationFromTransform(camera);

		expectedTranslation = new double[] { -2.00334072113, 2.33553338051,
				3.13046622276 };

		passed = HoneyBee.assertVectorsEqual(expectedTranslation,
				actualTranslation, SCALE);

		assertTrue(passed);

		actualRotation = HoneyBee.getRotationFromTransform(camera);

		expectedRotation = new double[][] {
				new double[] { 0.976672232151, -0.214735463262,
						-1.65507589855e-08 },
				new double[] { 0.0679054111242, 0.308851242065, 0.948683142662 },
				new double[] { -0.203715905547, -0.926552534103, 0.316228151321 } };

		passed = HoneyBee.assertMatricesEqual(expectedRotation, actualRotation,
				SCALE);

		assertTrue(passed);

		// perform global translation of -6,-7,-4

		object = HoneyBee.translateAlongGlobalAxes(object, -6, -7, -4);

		camera = BeeColony.cameraFollowsObject(object, BEHIND, ABOVE);

		actualTranslation = HoneyBee.getTranslationFromTransform(camera);

		expectedTranslation = new double[] { -8.00334072113, -4.66446685791,
				-0.869533836842 };

		passed = HoneyBee.assertVectorsEqual(expectedTranslation,
				actualTranslation, SCALE);

		assertTrue(passed);

		actualRotation = HoneyBee.getRotationFromTransform(camera);

		expectedRotation = new double[][] {
				new double[] { 0.976672232151, -0.214735463262,
						-1.65507589855e-08 },
				new double[] { 0.0679054111242, 0.308851242065, 0.948683142662 },
				new double[] { -0.203715905547, -0.926552534103, 0.316228151321 } };

		passed = HoneyBee.assertMatricesEqual(expectedRotation, actualRotation,
				SCALE);

		assertTrue(passed);

	}