void TuxDraw::DrawPants(const TuxPts *pTuxedo, ID2D1SolidColorBrush* pSuiteColor, ID2D1HwndRenderTarget* pRenderTarget) { FLOAT hipSpan = (pTuxedo->pts[JointType_HipRight].x - pTuxedo->pts[JointType_HipLeft].x) / 2.0f; DrawLeg(pTuxedo->pts[JointType_HipRight], pTuxedo->pts[JointType_KneeRight], pTuxedo->pts[JointType_AnkleRight], pSuiteColor,pRenderTarget); DrawLeg(pTuxedo->pts[JointType_HipLeft], pTuxedo->pts[JointType_KneeLeft], pTuxedo->pts[JointType_AnkleLeft], pSuiteColor, pRenderTarget); }
void Robot::DrawRobot(float xPos, float yPos, float zPos) { glPushMatrix(); glTranslatef(xPos, yPos, zPos); // draw robot at desired coordinates // draw head and torso parts DrawHead(1.0f, 2.0f, 0.0f); DrawTorso(1.5f, 0.0f, 0.0f); // move the left arm away from the torso and rotate it to give "walking" effect glPushMatrix(); glTranslatef(0.0f, -0.5f, 0.0f); glRotatef(armAngles[LEFT], 1.0f, 0.0f, 0.0f); DrawArm(2.5f, 0.0f, -0.5f); glPopMatrix(); // move the right arm away from the torso and rotate it to give "walking" effect glPushMatrix(); glTranslatef(0.0f, -0.5f, 0.0f); glRotatef(armAngles[RIGHT], 1.0f, 0.0f, 0.0f); DrawArm(-1.5f, 0.0f, -0.5f); glPopMatrix(); // move the left leg away from the torso and rotate it to give "walking" effect glPushMatrix(); glTranslatef(0.0f, -0.5f, 0.0f); glRotatef(legAngles[LEFT], 1.0f, 0.0f, 0.0f); DrawLeg(-0.5f, -5.0f, -0.5f); glPopMatrix(); // move the right leg away from the torso and rotate it to give "walking" effect glPushMatrix(); glTranslatef(0.0f, -0.5f, 0.0f); glRotatef(legAngles[RIGHT], 1.0f, 0.0f, 0.0f); DrawLeg(1.5f, -5.0f, -0.5f); glPopMatrix(); glPopMatrix(); // pop back to original coordinate system }