void Object3DParser::CreateLists(object3d *o) { o->displist=glGenLists(1); PUSH_CODE_MODE; ENTER_MIXED; glNewList(o->displist,GL_COMPILE); DrawSub(o); glEndList(); POP_CODE_MODE; for(std::vector<object3d*>::iterator bs=o->childs.begin();bs!=o->childs.end();bs++){ CreateLists(*bs); } }
void display(void) { glLoadIdentity(); gluLookAt( Sub.Pos.x + 24*sin(Sub.Rot.z), Sub.Pos.y + 24*cos(Sub.Rot.z), Sub.Pos.z, Sub.Pos.x + 36*sin(Sub.Rot.z), Sub.Pos.y + 36*cos(Sub.Rot.z), Sub.Pos.z, 0 , 0 , 1.0 ); // gluLookAt(100,200,200, Sub.Pos.x, Sub.Pos.y, Sub.Pos.z, 0.0, 0, 1.0); glPushMatrix(); float zerov[4] = {0,0,0,0}; glMaterialfv(GL_FRONT, GL_SPECULAR, zerov); glColor3f(0.0, 0.5, 1.0); DrawCylinderChain(rC); DrawSub(Sub); glPopMatrix(); glutSwapBuffers(); }