3D gamepad movement

Hi,
I’m writing a game with SDL and OpenGL. I’m having a problem with something,
though. I am trying to make my character move like in pretty much any other 3D
game. What I’m trying to do is set my player’s view vector and model/orientation
with the gamepad. What I mean is: I’m trying to make it so when I push up on the
control pad, the player will turn and face up, then if I keep pushing in that
direction, the player will then start running in that direction. Then if I push
right, the player looks right(model rotates, view vector rotates) then they
start running in that direction(if I’m still pushing right), etc. I’m just going
after the kind of gamepad control that say, a 3D Mario game has. Does anyone
know how to do this?
Thanks for any help…