No hip-rocking, correct; leg straight -- WRONG.
Sit on the bike.
One pedal down, pretty much 'in-line' with the seat tube. Heel on pedal.
If your knee is fully extended, you're good. This gives you a slight bend in the knee when you put the ball of your foot on the pedal.
You should BARELY be able to touch the toes of one foot to the ground when on the saddle.
As far as fore-and-aft measurement, when the pedal is pointing straight forward, the knee should be above the pedal. Close enough. After all, you're not racing for the national championship.