3d line drawing function