Melee in COD 3 (PS3)

I have successfully won when I'm engaged in h2h with my opponent several times. I gather that you are supposed to move the controller twisting left to right to melee your opponent.

But how do you get into a position to do that?
But it seems very random... what is the proper technique?

LP, RP, LP, LP, LK, LK, RK, LK, RP, LP+RP