// Test for drawing a mailbox. This program just draws a red mailbox. // By: Stella del Rosario #include #include //#include "sdelrosa.cc" #include float mailboxHeight=1; void light(){ // light comes from the upper right GLfloat direction[]={2,1,1,0}; twGrayLight(GL_LIGHT0, direction, 0.1,0.8,0.8); glEnable(GL_LIGHT0); } void display(void) { twDisplayInit(); twCamera(); // sets up camera based on bounding box coords. glPushAttrib(GL_ALL_ATTRIB_BITS); glEnable(GL_LIGHTING); glShadeModel(GL_SMOOTH); twAmbient(0.4); light(); // Draw red mailbox sdelrosaMailbox(mailboxHeight, 0); glPopAttrib(); glFlush(); glutSwapBuffers(); } int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); twInitWindowSize(800,650); glutCreateWindow(argv[0]); twBoundingBox(-0.5,0.5,0,mailboxHeight,-0.5,0.5); twMainInit(); glutDisplayFunc(display); glutMainLoop(); return 0; }