/* * These one-liners draw particular objects, fetching appropriate * information from the above globals. They are just thin wrappers * for the FreeGLUT objects. */ static void drawSolidTetrahedron(void) { glutSolidTetrahedron (); } static void drawWireTetrahedron(void) { glutWireTetrahedron (); } static void drawSolidCube(void) { glutSolidCube(orad); } /* orad doubles as size input */ static void drawWireCube(void) { glutWireCube(orad); } /* orad doubles as size input */ static void drawSolidOctahedron(void) { glutSolidOctahedron (); } static void drawWireOctahedron(void) { glutWireOctahedron (); } static void drawSolidDodecahedron(void) { glutSolidDodecahedron (); } static void drawWireDodecahedron(void) { glutWireDodecahedron (); } static void drawSolidRhombicDodecahedron(void) { glutSolidRhombicDodecahedron (); } static void drawWireRhombicDodecahedron(void) { glutWireRhombicDodecahedron (); } static void drawSolidIcosahedron(void) { glutSolidIcosahedron (); } static void drawWireIcosahedron(void) { glutWireIcosahedron (); } static void drawSolidSierpinskiSponge(void) { glutSolidSierpinskiSponge (depth, offset, orad);} /* orad doubles as size input */ static void drawWireSierpinskiSponge(void) { glutWireSierpinskiSponge (depth, offset, orad); } /* orad doubles as size input */ static void drawSolidTorus(void) { glutSolidTorus(irad,orad,slices,stacks); } static void drawWireTorus(void) { glutWireTorus (irad,orad,slices,stacks); } static void drawSolidSphere(void) { glutSolidSphere(orad,slices,stacks); } /* orad doubles as size input */ static void drawWireSphere(void) { glutWireSphere(orad,slices,stacks); } /* orad doubles as size input */ static void drawSolidCone(void) { glutSolidCone(orad,orad,slices,stacks); } /* orad doubles as size input */ static void drawWireCone(void) { glutWireCone(orad,orad,slices,stacks); } /* orad doubles as size input */ static void drawSolidCylinder(void) { glutSolidCylinder(orad,orad,slices,stacks); } /* orad doubles as size input */ static void drawWireCylinder(void) { glutWireCylinder(orad,orad,slices,stacks); } /* orad doubles as size input */
/* * These one-liners draw particular objects, fetching appropriate * information from the above globals. They are just thin wrappers * for the FreeGLUT objects. */ static void drawSolidTetrahedron(void) { glutSolidTetrahedron (); } static void drawWireTetrahedron(void) { glutWireTetrahedron (); } static void drawSolidCube(void) { glutSolidCube(orad); } /* orad doubles as size input */ static void drawWireCube(void) { glutWireCube(orad); } /* orad doubles as size input */ static void drawSolidOctahedron(void) { glutSolidOctahedron (); } static void drawWireOctahedron(void) { glutWireOctahedron (); } static void drawSolidDodecahedron(void) { glutSolidDodecahedron (); } static void drawWireDodecahedron(void) { glutWireDodecahedron (); } static void drawSolidRhombicDodecahedron(void) { glutSolidRhombicDodecahedron (); } static void drawWireRhombicDodecahedron(void) { glutWireRhombicDodecahedron (); } static void drawSolidIcosahedron(void) { glutSolidIcosahedron (); } static void drawWireIcosahedron(void) { glutWireIcosahedron (); } static void drawSolidSierpinskiSponge(void) { glutSolidSierpinskiSponge (depth, offset, orad);} /* orad doubles as size input */ static void drawWireSierpinskiSponge(void) { glutWireSierpinskiSponge (depth, offset, orad); } /* orad doubles as size input */ static void drawSolidTorus(void) { glutSolidTorus(irad,orad,slices,stacks); } static void drawWireTorus(void) { glutWireTorus (irad,orad,slices,stacks); } static void drawSolidSphere(void) { glutSolidSphere(orad,slices,stacks); } /* orad doubles as size input */ static void drawWireSphere(void) { glutWireSphere(orad,slices,stacks); } /* orad doubles as size input */ static void drawSolidCone(void) { glutSolidCone(irad,orad,slices,stacks); } /* irad doubles as base input, and orad as height input */ static void drawWireCone(void) { glutWireCone(irad,orad,slices,stacks); } /* irad doubles as base input, and orad as height input */ static void drawSolidCylinder(void) { glutSolidCylinder(irad,orad,slices,stacks); } /* irad doubles as radius input, and orad as height input */ static void drawWireCylinder(void) { glutWireCylinder(irad,orad,slices,stacks); } /* irad doubles as radius input, and orad as height input */
static void drawWireCylinder(void) { glutWireCylinder(1,1,slices,stacks); }
/*!***************************************************************************** ******************************************************************************* \note myDrawGLElement \date August 7, 1992 \remarks draws a GL element of a particular length in z direction ******************************************************************************* Function Parameters: [in]=input,[out]=output \param[in] num : ID number of element (just for info) \param[in] length: length of element \param[in] flag : draw joint element (yes, not) ******************************************************************************/ static void myDrawGLElement(int num, double length, int flag) { static int firsttime = TRUE; double width=0.03; double head_width = 0.3; double hand_width = 0.07; double foot_width = 0.1; double torso_width = 0.3; double belly_width = 0.25; double thumb_width = 0.02; double shoulder_width = 0.4; static int pelvis,b_tr,b_taa,b_tfe; static int l_haa, l_hfe, l_hfr, l_kfe, l_ar, l_afe, l_aaa; static int r_haa, r_hfe, r_hfr, r_kfe, r_ar, r_afe, r_aaa; static int b_hn, b_ht, b_hr; static int head,left_eye,right_eye; static int r_sfe, r_saa, r_hr, r_eb, r_wr, r_wfe, r_waa; static int l_sfe, l_saa, l_hr, l_eb, l_wr, l_wfe, l_waa; GLfloat gray[4]={(float)0.8,(float)0.8,(float)0.8,(float)opacity}; GLfloat green[4]={(float)0.1,(float)0.5,(float)0.5,(float)opacity}; GLfloat red[4]={(float)1.0,(float)0.25,(float)0.25,(float)opacity}; GLfloat blue[4]={(float)0.1,(float)0.1,(float)1.0,(float)opacity}; GLfloat black[4]={(float)0.,(float)0.,(float)0.0,(float)opacity}; GLfloat white[4]={(float)1.,(float)1.,(float)1.0,(float)opacity}; GLfloat yellow[4]={(float)1.0,(float)0.8,(float)0.7,(float)opacity}; int isphere = 10; if (solid) glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); else glPolygonMode( GL_FRONT_AND_BACK, GL_LINE ); if (firsttime) { firsttime = FALSE; char *lab_root; char fname[300]; lab_root = getenv("LAB_ROOT"); sprintf(fname,"%s/hermesCore/3D/Pelvis.obj",lab_root); pelvis = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/B_TR.obj",lab_root); b_tr = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/B_TAA.obj",lab_root); b_taa = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/B_TFE.obj",lab_root); b_tfe = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_HFE.obj",lab_root); l_hfe = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_HAA.obj",lab_root); l_haa = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_HFR.obj",lab_root); l_hfr = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_KFE.obj",lab_root); l_kfe = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_AR.obj",lab_root); l_ar = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_AFE.obj",lab_root); l_afe = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_AAA.obj",lab_root); l_aaa = displayListFromObjFileFlag(fname,0.0256,FALSE); sprintf(fname,"%s/hermesCore/3D/L_HFE.obj",lab_root); r_hfe = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_HAA.obj",lab_root); r_haa = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_HFR.obj",lab_root); r_hfr = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_KFE.obj",lab_root); r_kfe = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_AR.obj",lab_root); r_ar = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_AFE.obj",lab_root); r_afe = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/R_AAA.obj",lab_root); r_aaa = displayListFromObjFileFlag(fname,0.0256,FALSE); sprintf(fname,"%s/hermesCore/3D/B_HN.obj",lab_root); b_hn = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/B_HT.obj",lab_root); b_ht = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/B_HR.obj",lab_root); b_hr = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/humanoidHeadLeftEye.obj",lab_root); left_eye = displayListFromObjFile(fname,0.0256); sprintf(fname,"%s/hermesCore/3D/humanoidHeadRightEye.obj",lab_root); right_eye = displayListFromObjFile(fname,0.0256); sprintf(fname,"%s/hermesCore/3D/humanoidHead.obj",lab_root); head = displayListFromObjFile(fname,0.0256); sprintf(fname,"%s/hermesCore/3D/R_SFE.obj",lab_root); r_sfe = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/R_SAA.obj",lab_root); r_saa = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/R_HR.obj",lab_root); r_hr = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/R_EB.obj",lab_root); r_eb = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/R_WR.obj",lab_root); r_wr = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/R_WFE.obj",lab_root); r_wfe = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/R_WAA.obj",lab_root); l_waa = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_SFE.obj",lab_root); l_sfe = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_SAA.obj",lab_root); l_saa = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_HR.obj",lab_root); l_hr = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_EB.obj",lab_root); l_eb = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_WR.obj",lab_root); l_wr = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_WFE.obj",lab_root); l_wfe = displayListFromObjFileFlag(fname,0.0256,TRUE); sprintf(fname,"%s/hermesCore/3D/L_WAA.obj",lab_root); r_waa = displayListFromObjFileFlag(fname,0.0256,TRUE); } if (flag==1 && num != 35 && num != 37) { glTranslated(0.0,0.0,length); if (num==999) {/* the base coordinate system */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, blue); glColor4fv(blue); } else if (num > 38) { glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); } else { glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, green); glColor4fv(green); } if (num == B_HN || num == B_HT) { if (solid) glutSolidSphere(0.25*width,isphere,isphere); else glutWireSphere(0.25*width,isphere,isphere); } else { if (solid) glutSolidSphere(0.25*width,isphere,isphere); else glutWireSphere(0.25*width,isphere,isphere); } glTranslated(0.0,0.0,-length); } switch (num) { case BASE: break; case L_SAA: /* L_SFE */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)135.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glRotated((GLdouble)180.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glTranslated(-0.002,-0.005,0.290); glCallList(l_sfe); break; case L_HR: /* L_SAA */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glRotated((GLdouble)180.,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glTranslated(-0.2,-0.005,0.490); glCallList(l_saa); break; case L_EB: /* L_HR */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); //glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); //glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(-0.222,-0.005,0.495); glCallList(l_hr); break; case L_WR: /* L_EB */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(-0.223,-0.005,0.240); glCallList(l_eb); break; case L_WFE: /* L_WR */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)180.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); //glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(-0.223,-0.000,0.2150); glCallList(l_wr); break; case L_WAA: /* L_WFE */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glRotated((GLdouble)-90.,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glTranslated(-0.22,-0.000,-0.017); glCallList(l_wfe); break; case 108: /* L_WAA */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); //glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(0.220,-0.020,-0.017); glCallList(l_waa); break; case R_SAA: /* R_SFE */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)135.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(0.0,-0.005,0.290); glCallList(r_sfe); break; case R_HR: /* R_SAA */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(0.2,-0.005,0.490); glCallList(r_saa); break; case R_EB: /* R_HR */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); //glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); //glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(0.222,-0.005,0.490); glCallList(r_hr); break; case R_WR: /* R_EB */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(0.223,-0.005,0.2350); glCallList(r_eb); break; case R_WFE: /* R_WR */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)0.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); //glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(0.223,-0.000,0.2150); glCallList(r_wr); break; case R_WAA: /* R_WFE */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glRotated((GLdouble)90.,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glTranslated(0.22,-0.000,-0.017); glCallList(r_wfe); break; case 115: /* R_WAA */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); //glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(-0.220,-0.020,-0.017); glCallList(r_waa); break; break; case B_TR: /* pelvis */ glPushMatrix(); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)180.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); //glTranslated(0.0,0.0,0.1); glCallList(pelvis); glPopMatrix(); // draw IMU glTranslated(-IMU_X_OFFSET,IMU_Y_OFFSET,0.0); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, red); glColor4fv(red); glScaled(0.02,0.01,0.04); if (solid) glutSolidCube(1.0); else glutWireCube(1.0); break; case B_TAA: /* B_TR */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); //glRotated((GLdouble)180.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(0.0,0.0,0.1725); glCallList(b_tr); break; case B_TFE: /* B_TAA */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glTranslated(0.0,0.0,0.1725); glCallList(b_taa); break; case B_HN: /* B_TFE */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)180.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glRotated((GLdouble)180.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glTranslated(-0.004,-0.005,0.1725); // strange lateral offset .... glCallList(b_tfe); break; case L_HFE: /* L_HAA */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(0.09,0.0,0.0); glCallList(l_haa); break; case L_HFR: /* L_HFE */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); //glRotated((GLdouble)90.,(ppGLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(0.09,0.0,0.0); glCallList(l_hfe); break; case L_KFE: /* L_HFR */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glRotated((GLdouble)-8.5,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glTranslated(0.09,-0.06,-0.01); glCallList(l_hfr); break; case L_AR: /* L_KFE */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glTranslated(0.09,0.0,-0.404); glCallList(l_kfe); break; case L_AFE: /* L_AR */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); //glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glTranslated(0.09,0.0,-0.404); glCallList(l_ar); break; case L_AAA: /* L_AFE */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glRotated((GLdouble)180.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glTranslated(0.09,0.0,-0.784); glCallList(l_afe); break; case 128: /* L_AAA */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); //glRotated((GLdouble)180.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glScaled(MAG,MAG,1.0); glTranslated(0.08,0.0,-0.78); glCallList(l_aaa); break; case R_HFE: /* R_HAA */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)-90.,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(0.095,0.0,0.0); glCallList(r_haa); break; case R_HFR: /* R_HFE */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); //glRotated((GLdouble)90.,(ppGLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(0.09,0.0,0.0); glCallList(r_hfe); break; case R_KFE: /* R_HFR */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glRotated((GLdouble)-8.5,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glTranslated(0.09,-0.06,-0.01); glCallList(r_hfr); break; case R_AR: /* R_KFE */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glTranslated(0.09,0.0,-0.404); glCallList(r_kfe); break; case R_AFE: /* R_AR */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); //glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glTranslated(0.09,0.0,-0.404); glCallList(r_ar); break; case R_AAA: /* R_AFE */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glRotated((GLdouble)180.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glTranslated(0.09,0.0,-0.784); glCallList(r_afe); break; case 135: /* R_AAA */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); //glRotated((GLdouble)180.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glScaled(MAG,MAG,1.0); glTranslated(-.08,0.0,-0.78); glCallList(r_aaa); break; case B_HT: /* B_HN */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glRotated((GLdouble)180.,(GLdouble)0.,(GLdouble)1.,(GLdouble)0.); glTranslated(-0.004,-0.006,0.56); glCallList(b_hn); break; case B_HR: /* B_HT */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); //glRotated((GLdouble)-90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glRotated((GLdouble)-90.,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glTranslated(-0.004,-0.006,0.56); glCallList(b_ht); break; case 138: /* the head */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, white); glColor4fv(white); glRotated((GLdouble)90.,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glTranslated(-0.035,-0.04+.12,-0.065); glCallList(head); break; case 35: /* dummies */ case 37: /* dummies */ break; case 137: /* the right eye */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glRotated((GLdouble)180.,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glTranslated(-0.072,-0.0545,0.00); glCallList(right_eye); glTranslated(0.072,0.0545,-.022); glPushMatrix(); glScaled(0.02,0.02,0.001); glColor4fv(black); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, black); if (solid) glutSolidCylinder(1.0,1.0,isphere*2,1); else glutWireCylinder(1.0,1.0,isphere*2,1); glPopMatrix(); glTranslated(0.0,0.0,-0.001); glPushMatrix(); glScaled(0.007,0.007,0.001); glColor4fv(white); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, white); if (solid) glutSolidCylinder(1.0,1.0,isphere*2,1); else glutWireCylinder(1.0,1.0,isphere*2,1); glPopMatrix(); glTranslated(0.0,-0.017,0.0); glPushMatrix(); glScaled(0.006,0.006,0.01); glColor4fv(gray); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); if (solid) glutSolidCylinder(1.0,1.0,isphere*2,1); else glutWireCylinder(1.0,1.0,isphere*2,1); glPopMatrix(); break; case 139: /* the left eye */ glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); glColor4fv(gray); glRotated((GLdouble)90.,(GLdouble)0.,(GLdouble)0.,(GLdouble)1.); glRotated((GLdouble)180.,(GLdouble)1.,(GLdouble)0.,(GLdouble)0.); glTranslated(0.00,-0.0545,0.0); glCallList(left_eye); glTranslated(0.0,0.0545,-0.022); glPushMatrix(); glScaled(0.02,0.02,0.001); glColor4fv(black); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, black); if (solid) glutSolidCylinder(1.0,1.0,isphere*2,1); else glutWireCylinder(1.0,1.0,isphere*2,1); glPopMatrix(); glTranslated(0.0,0.0,-0.001); glPushMatrix(); glScaled(0.007,0.007,0.001); glColor4fv(white); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, white); if (solid) glutSolidCylinder(1.0,1.0,isphere*2,1); else glutWireCylinder(1.0,1.0,isphere*2,1); glPopMatrix(); glTranslated(0.0,-0.017,0.0); glPushMatrix(); glScaled(0.006,0.006,0.01); glColor4fv(gray); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, gray); if (solid) glutSolidCylinder(1.0,1.0,isphere*2,1); else glutWireCylinder(1.0,1.0,isphere*2,1); glPopMatrix(); break; case 129: /* dummies of feet */ case 130: case 131: case 132: case 133: case 134: case 122: case 123: case 124: case 125: case 126: case 127: /* glScaled(width/2.,width/2.,length); glTranslated(0.0,0.0,0.5); glColor4fv(gray); if (solid) glutSolidCube(1.0); else glutWireCube(1.0); */ break; case 152: case 155: case 158: case 161: case 164: case 166: case 169: case 172: case 175: case 178: glPushMatrix(); glTranslated(0.0,0.0,length); if (solid) glutSolidSphere(0.25*width,isphere,isphere); else glutWireSphere(0.25*width,isphere,isphere); glPopMatrix(); default: glScaled(width/4,width/4,length); glColor4fv(gray); if (solid) glutSolidCylinder(1.0,1.0,isphere,1); else glutWireCylinder(1.0,1.0,isphere,1); } }