protected static boolean coplanarTriangles( Vector3f n, Triangle t1, Triangle t2 )
	{
		// First project onto an axis-aligned plane that maximizes the are of the triangles.
		int i0;
		int i1;

		float[] a = new float[]{ Math.abs( n.getX() ), Math.abs( n.getY() ), Math.abs( n.getZ() ) };
		if ( a[0] > a[1] ) // X > Y
		{
			if ( a[0] > a[2] )
			{ // X is greatest
				i0 = 1;
				i1 = 2;
			}
			else
			{ // Z is greatest
				i0 = 0;
				i1 = 1;
			}
		}
		else // X < Y
		{
			if ( a[2] > a[1] )
			{ // Z is greatest
				i0 = 0;
				i1 = 1;
			}
			else
			{ // Y is greatest
				i0 = 0;
				i1 = 2;
			}
		}

		// Test all edges of triangle 1 against the edges of triangle 2.
		float[] v0 = new float[]{ t1.getPoint1().getX(), t1.getPoint1().getY(), t1.getPoint1().getZ() };
		float[] v1 = new float[]{ t1.getPoint2().getX(), t1.getPoint2().getY(), t1.getPoint2().getZ() };
		float[] v2 = new float[]{ t1.getPoint3().getX(), t1.getPoint3().getY(), t1.getPoint3().getZ() };

		float[] u0 = new float[]{ t2.getPoint1().getX(), t2.getPoint1().getY(), t2.getPoint1().getZ() };
		float[] u1 = new float[]{ t2.getPoint2().getX(), t2.getPoint2().getY(), t2.getPoint2().getZ() };
		float[] u2 = new float[]{ t2.getPoint3().getX(), t2.getPoint3().getY(), t2.getPoint3().getZ() };

		boolean tf = triangleEdgeTest( v0, v1, u0, u1, u2, i0, i1 );
		if ( tf )
			return true;

		tf = triangleEdgeTest( v1, v2, u0, u1, u2, i0, i1 );
		if ( tf )
			return true;

		tf = triangleEdgeTest( v2, v0, u0, u1, u2, i0, i1 );
		if ( tf )
			return true;

		// Finally, test whether one triangle is contained in the other one.
		tf = pointInTri( v0, u0, u1, u2, i0, i1 );
		if ( tf )
			return true;

		return pointInTri( u0, v0, v1, v2, i0, i1 );
	}