In this paper, we introduce a novel Model Predictive Control (MPC) formulation applied to the motion dynamics of a bipedal robot, where we represent the system dynamics using a single rigid body model in 3D space. To address the presence of nonlinear factors, we employ a variation-based method to linearize the rotation matrix and angular velocity vector and formulate a new terminal cost function with a self-adjusting factor to reduce computing consumption. The controller is ultimately transformed into a Quadratic Program (QP) to enable real-time online solutions. Finally, we validate the feasibility of the control strategy through walking gait tests on level ground and hill-climbing tests on a 30-degree slope, and it is successful for both of them.