/* Mala Sarkar CS307 Fall 2005 Demo of Ottoman */ #include #include #include //#include "msarkar.cc" #include //default scaling for ottoman const int ottomanScale = 10; //default colors of ottoman twTriple sienna = {0.8,0.41,0.22}; twTriple darkSienna = {0.55,0.28,0.15}; void setLight () { glEnable(GL_LIGHTING); //directional light GLfloat light0[4]={1,1,1,0}; twGrayLight(GL_LIGHT0,light0,0.3,0.4,0.1); } void display(void) { twDisplayInit(); twCamera(); //set up camera based on bounding box coordinates setLight(); glShadeModel(GL_SMOOTH); //draw ottoman msarkarOttoman(ottomanScale,sienna,darkSienna); glFlush(); glutSwapBuffers(); // necessary for animation } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); twInitWindowSize(650,650); glutCreateWindow(argv[0]); glutDisplayFunc(display); //create a bounding box tailored to fit the dimensions of the ottoman twBoundingBox(-ottomanScale, ottomanScale,-0.5*ottomanScale,0.5*ottomanScale,-ottomanScale,ottomanScale); twMainInit(); glutMainLoop(); return 0; }