Notes for Homework 8
- NOTE: Make sure to update your webpage with images from this assignment!
- Code to read and write PPM and BMP images is available here.
- Example executables for Windows and
Linux.
- If you get an Windows error when running the Windows example, you may have conflicting copies of GLEW.
- Try deleting the glew32.dll that comes with the example.
- If you get an X-Error when running the Linux example, I bet you're trying to run the program remotely.
- Try running locally on your machine, or go to MLH 301 and run it on the lab machines.
- Code snippet to draw in the lower
right corder, as per Problem 4.
- You may wish to look at the functions glPushAttrib() and
glPopAttrib().
- Things to note:
- Depth buffering should be enabled for this assignment. Make sure you glEnable(GL_DEPTH_TEST),
and specify you want a depth buffer in glutInitDisplayMode( GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH ).
- Load textures and objects in an initialization routine (not in your display code) so you don't
slow down your program by loading every frame!
- This paper is a complex read, but has
useful information about setting up texture coordinates for shadow mapping.
- My directory of textures.
- My directory of models.
- If you are using Visual Studio, a number of OpenGL constants and functions needed for this assignment
may not be defined in your "GL/gl.h" file (looks like some newish versions of VS.Net
ship with OpenGL Version 1.1 headers). However, you can still use these functions, you
just need to:
- Download GLEW Binaries
- Copy "glew.h", "glxew.h", and "wglew.h" to Microsoft's "include/GL/" directory (the same directory that
has "gl.h" and "glut.h").
- Copy "glew32.lib" and "glew32s.lib" to Microsoft's "lib/" directory (the same directory that has "glut32.lib"
and "opengl32.lib").
- Copy "glew32.dll" either to your "Windows/System32" directory or into the same directory as your executable.
- Include "glew32.lib" while linking (goto Menu: "Project->{projectName} Properties", select
"Configuration Properties->Linker->Input", and change "Additional Dependancies" to be
"glew32.lib glut32.lib glu32.lib opengl32.lib".
- "#include < GL/glew.h >" in your program.
- Call "glewInit();" in main() right after "glutCreateWindow( ... );"
Last Modified: Monday, October 17, 2005
Chris Wyman (cwyman@cs.uiowa.edu)