Raycasting in x and z planes