Fixing glmatrix and 2d plane intersection