modify to treat intersection test with a triangle parallel to z-axis