// Demo for ECE660, 9/21/98, F.S.Hill,Jr. // bare bones Canvas class.. /* Draw a rotating rosette of numSides sides. Increase/decrease numSides with 'n"/'N', and increase/decrease rotation speed with 'r'/'R' */ //#include #include #include #include #include #include #include #include #include #include "mamd.h" //######################## GLOBALS ################################# int screenWidth,screenHeight;float xpos,ypos,zpos,dim=1.0,old_dim,dz; float angle,delAngle,xmax=1.0,ymax=1.0,zmax=1.0; char name[]="radhika"; objects *obj;GLenum mode=GL_POLYGON; //<<<<<<<<<<<<<<<<<<<<<<<<<<<<< display >>>>>>>>>>>>>>>>>>>>>> void display(void) { glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);// clear screen obj->draw_object(&mode); glRasterPos2f(-(strlen(name)/2),old_dim); for(int i=0;name[i]!='\0';i++) { glutBitmapCharacter(GLUT_BITMAP_HELVETICA_12,name[i]); glColor3f(0.5,0.5,0.4);} glutSwapBuffers(); // swap buffers for smooth animation cout<<"display called"<>>>>>>>>>>>>>>>>> void myInit() { glEnable(GL_DEPTH_TEST); glClearColor(1.0f,1.0f,1.0f,1.0f); // background is white glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-dim,dim,-dim,dim,-dim,dim); glViewport(0,0,screenWidth,screenHeight); //the default } //<<<<<<<<<<<<<<<<<<<<<<< myKeys >>>>>>>>>>>>>>>>>>>>>>>> void myKeys(unsigned char key, int x, int y) { char flag ='0'; switch(key) { case 'q': exit(0); // quit case 'x': glRotatef(5,1,0,0);flag='1'; cout<0)?dim:(dim+dz);flag='1'; cout<<"dim -"<>>>>>>>>>>>>>> void spinner(void) // the idle function { angle += delAngle; // increase rotation angle display(); } //<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> void mouse_func(int button,int state,int x,int y ) { static float xtrans,ytrans; cout<<" mouse activated"<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> void menu_choice(int val) { if(val==1) mode=GL_LINE_STRIP; if(val==2) mode=GL_POLYGON; glutPostRedisplay(); cout<<" again display"<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> void main(int argc, char *argv[]) { obj=new objects(argv[1]); dim=0.3+obj->readfile(); cout<<"dim is "<-->