//Jackie Weber /* My object for the Object Library table(...) takes five parameters 1) float tablePostLeftX 2) float tablePostRightX 3) float tablePostTopZ 4) float tablePostBottomZ 5) int tex - number of texID to be used for table legs 1-4 are the positions of the table legs. This is assuming a normal coordinate system with a normal (down the z axis) camera view. The size of the top of the table is: tablePostRightX-tablePostLeftX tablePostTopZ-tablePostBottomZ y=4*/ #include #include #include #include #include //location of table posts for table const double tablePostLeftX=-3; const double tablePostRightX=5; const double tablePostTopZ=-5; const double tablePostBottomZ=5; GLuint textureIDs[1]; void texInit() { glGenTextures(1,textureIDs); twLoadTexture(textureIDs[0],"wood.ppm"); } void display (void){ twDisplayInit(); twCamera(); jweber2Table2(tablePostRightX,tablePostLeftX,tablePostTopZ,tablePostBottomZ,textureIDs[0]); 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(-4,6,-1,5,-8,8); twMainInit(); texInit(); glutMainLoop(); return 0; }