用C++OpenGL实现3D简易人@TOC
核心代码:
void object()
{
// lightsphere();
glRotatef(rotating_theta, 0.0, 1.0, 0.0);//rotating along the y axis
glRotatef(theta[0], 1.0, 0.0, 0.0);//bending the body
//draw the main body including chest, waist and belly
chest();
waist();
head();
belly();
glPushMatrix();//save the current matrix
glTranslatef(CHEST_LENGTH / 2 + LOWER_ARM_WIDTH / 2, 0, 0.0);//move the arm to the left side of the body
glRotatef(theta[1], -1.0, 0.0, 0.0);//bending the arm
upper_arm();//draw the left upper arm
glTranslatef(0.0, LOWER_ARM_HEIGHT, 0.0);//move the bottom os the upper arm to the top of the lower arm
// glRotatef(theta[2], 1.0, 0.0, 0.0);//bending the arm
lower_arm();//draw the left lower arm
glPopMatrix();//load the