OpenGL related resources

OpenGL Tutorial (PowerPoint file)
Environment Setting
  • Here, it is assumed that you are using Visual C++ and glut library on Windows
  • 2000/XP platforms.
  • Download glutdlls.zip and extract to temporary directory.
  • Copy glut.h to include/GL directory under Visual C++.
  • Copy glut32.lib to lib directory under Visual C++ directory.
  • Copy glut32.dll to Windows/System32 (XP) or Winnt/System32 (2000) directory.
  • glut.lib and glut.dll are not used.
  • IMPORTANT: For those who will do the homework on Tompkins Hall, copy this version of glut32.dll under the "Debug" directory which is generated after you compile your project.
Download the Sample Application
  • Download SimpleGLUT.zip and extract it.
  • Open the Project file from Visual C++
  • Compile and Run the application
Description of the Source Code
  • Four callback functions are defined in the main() function
  • glutDisplayFunc(display); //For rendering the scene
  • glutReshapeFunc(reshape); //Initializing the Windows size and viewing/model transformation
  • glutKeyboardFunc(keyboard);//Press ECS key to end the application
  • glutIdleFunc(idle); //Increment the teapot rotating angle by 5 degree.
  • In display(void) function
  • glutSolidTeapot(1.0); //Render a teapot with size 1.0
  • sprintf(filename, "test%.04d.tif", framename); //define the output image file name based on frame number
  • writetiff(filename, "movie", 0, 0, Width, Height, COMPRESSION_NONE); //write to a tiff image file.
Related Links
Back to Resources Page