Created a plane object and made the calculation for intersection