/* Demonstrates constructing a scene using library objects. The scene is not intended to be beautiful, just functional. Written by Scott D. Anderson scott.anderson@acm.org Fall 2006 */ #include #include #include #include const float maxbyte = 255.0; // maximum value of an unsigned byte void display(void) { twDisplayInit(); twCamera(); // draw ground twColorName(TW_GREEN); twGround(); // draw sky twTriple lightSkyBlue = { 135/maxbyte, 206/maxbyte, 250/maxbyte }; twColor(lightSkyBlue,0,0); twSky(); // Justine's temple might be nice. This color is Slate Gray twTriple templeColor = { 112/maxbyte, 128/maxbyte, 144/maxbyte }; twColor(templeColor,0,0); glPushMatrix(); glTranslatef(-10,0,-30); glRotatef(75,0,1,0); // mostly side view jaylmerTemple(); glPopMatrix(); // draw barn glPushMatrix(); glTranslatef(-40,0,-125); glRotatef(-90,0,1,0); glScalef(40,35,50); twTriple teal = {0,0.5,0.5}; twTriple dark_blue = {0,0,0.5}; twTriple cyan = {0,1,1}; twSolidBarn(teal,dark_blue,cyan); glPopMatrix(); glFlush(); glutSwapBuffers(); // necessary for animation } 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(-50,50,0,60,-100,0); glLineWidth(2); twMainInit(); glutMainLoop(); return 0; }