Homework 2, due Thu Sep 19 at start of class.
- (This question will take some thinking).
Imagine that you have an infinitely large room illuminated
by one infinitely long row of point lights. This figure
shows a side view of the room.
The lights are h above the floor and are 1
meter from each other. Assume that the ceiling above the
lights is black and that no light reflects off of anything.
An object at distance d from a light gets illuminated
with a brightness 1/d2 .
Each point on the floor is illuminated by all the lights,
but more brightly by the closer lights.
A point p directly below a light will be a little
brighter than a point q halfway between two such
points. That is the problem --- we want the floor (at least
the part directly below the line of lights) to be evenly
lit, at least within 1%.
However, the higher the line of lights, the more evenly the
floor will be lit.
Your question is to tell us what is the minimum value for
h so that the line of the floor below the line of
lights is evenly lit within 1%.
- Imagine that you are creating a movie that is 2 hours long,
with 30 frames per second. Each frame is 1000x1500 pixels.
Each pixel uses 3 bytes of storage (before compression).
- How many pixels does the movie contain?
- If you can compress the data by a factor of 30, so that each pixel takes only 0.1 bytes, how much storage will the movie take?
- How many DVDs, at 4.7x109 bytes each is that?
- If the movie is being streamed as you watch it, how many bits per second are needed?
- Comment on the numbers I gave you to work with. Are they
reasonable?
- OpenGL programming:
- Go to Nate Robin's excellent opengl site at http://www.xmission.com/~nate/glut.html .
- Install the following on your system if necessary.
Download
http://www.xmission.com/~nate/glut/glut-3.7.6-bin.zip
(117 KB), uncompress it , you will find glut.h, glut32.lib and
the glut32.dll file, then do one of the following, depending on your environment:
- Visual studio.net:
- Copy glut.h to $(VISSTUDIONETDIR\Vc7\PlatformSDK\include\gl
- Copy glut32.lib to $(VISSTUDIONETDIR\`Vc7\PlatformSDK\lib
- Copy glut32.dll to $(WINDOWSS)\system32
- Visual C++:
- Copy glut.h to $(VISSTUDIONETDIR\VC98\include\gl
- Copy glut32.lib to $(VISSTUDIONETDIR\VC98\lib
- Copy glut32.dll to $(WINDOWS)\system32
- SuSE Linux:
- Install the freeglut and freeglut-devel packages.
- Use the -lglut switch when compiling.
- Download: http://www.xmission.com/~nate/glut/glut-3.7.6-src.zip (4.76 MB), uncompress it, find the "test\glut" directory and choose one of the sample code to verify your installation. I recommend bigtest or shape_test.
- Do Angel exercise 1.10 on page 38.
- Do Angel exercise 1.11 on page 38.