// Zaza Kabayadondo // CS 307 // Assignment 4 // 17 October 2006 // Using Material and Lighting to produce a creative scene // My scene will be the start of my final project. // For the project I want to // create a jazz club, with an audience sitting at candlelit tables and // sipping wine while watching a jazz band play. The jazz band will be onstage, // a pianist, sax and bass players,and a diva singing. // My scene now will be a table with the saxophone on it. #include #include #include #include #include //#include // for the couch- later #include GLfloat Light0Ambient = 0.7; GLfloat Light0Diffuse = 1.0; GLfloat Light0Specular = 0.7; void display(void) { twDisplayInit(); twCamera(); GLfloat pos[] = { 1, 1, 1, 0 }; // light from above back right twGrayLight(GL_LIGHT0,pos, Light0Ambient, Light0Diffuse, Light0Specular); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glShadeModel(GL_SMOOTH); zkabayadTable(true); glPushMatrix(); glTranslatef(0,12+3,0); // to the top of the table, plus half the height of the sax glRotatef(90,0,1,0); // easier to see the sax this way glScalef(3,3,3); // sax is now 6 units high. zkabayadSax(true); glPopMatrix(); glFlush(); glutSwapBuffers(); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); twInitWindowSize(500,500); glutCreateWindow(argv[0]); glutDisplayFunc(display); twBoundingBox(-3,3, // x-axis 0,18, // y-axis -3,3); // z-axis twMainInit(); glutMainLoop(); return 0; }