David Reed's Homepage

 

 

Mountain Smoke

My Homepage

My Resume

Tech Stuff

My Bio

Pictures

Friend's Pages

Links

Utilities

Fun

White Squirrel Cam

David's Lighting Laboratory


Developed by: David Reed

Advisor: Dr. Wayne Lang

Computer Science Dept. UNC-A

Presented: November 30, 1998

Abstract

In the CSCI 346 class, Computer Graphics, the OpenGL library was explored. The class stopped short of exploring lighting techniques used by OpenGL. My SEnior Project utililizes the techniques by implementing the different types of lighting. Ambient, specular, distant, positional, and spot lights were examined in detail. Shadows were also implemented to add realism to the scene. My project was done on the alpha UNIX workstations which have the OpenGL libraries installed.

My method of exploring light with OpenGL started by rendering a three-dimensional object. I chose the torus because of its curves enhance the material qualities of the object. I then declared four different lights to be used on the scene. One is a spotlight that has only a cone of light. Another is a distant light that shows the effect of light from a faraway source. The last two lights are positional lights that emit rays in all directions. Using GLUT, Graphical Library Utility Toolkit, I made a menu that allows the user to select which lights are to be used and also their color. Any combination can be chosen. Shadows are then created by flattening the object onto the plane in which it is projected. By taking the plane and the position and direction of the light source, shadows can be created. Three shadows were cast in this manner and added to the scene. Added to the menu were choices for the material of the object. These different materials demonstrate the ambient and specular qualities of the object.

Problems encountered were user, program, and time constraints. I did not have a user to give me feedback on the program since this program was not made for any one specific user. I had to decide what to do and how to do it. I had to be sure the code and the program were user friendly. There were programming problems as well. If I made the 3-D object too complex like a teapot, the program slowed down dramatically. Shadows were sometimes rendered as white, but I never found out why. If the spotlight is a cone of light, the bottom shadow turns white. A proven code that was documented would not work as indicated. Time was the last problem that had to be dealt with. I had to devise deadlines to make sure intermediate goals were met. I also had to schedule what work was to be done when I was on campus because I commute from over an hour away. Scheduling became very important.

The next step would be the addition of greater input by the user to control the scene. Slide bars widgets could be added to control color, material characteristics, and spotlight focusing. This would allow the user to see exactly what he/she wanted.

Development of this project helped me learn more about graphical programming and specifically, of OpenGL programming. It has made me more aware of project management requirements and the scheduling that needs to be maintained to complete the final project on time. I was able to successfully program a graphical environment that allows the user to look at different types of lighting techniques in detail.

User Manual

"David's Lighting Laboratory" is a program that uses OpenGL and explores different lighting techniques in a three-dimentional environment. To run the program, simply double click the icon.

Starting the menu - Move the mouse pointer inside of the window, and hold the right mouse button until the menu pops up. Make your selection by moving the mouse pointer over your selection, which will be highlighted, and release the right mouse button.

Enabling/Disabling a light - Pull up the menu and move the mouse to the light source you want enabled/disabled. You can choose "Left Light", "Right Light", "Distant Light", or "SpotLight". A sub menu will pop up. Select the color you would like the light to be and release the right mouse button. If you would like the light turned off, select disable.

Starting/Stopping the object from spinning - Pull up the menu and select either "stop motion" or "start motion".

Changing the material of the object - Pull up the menu and select "torus". A submenu will then pop up. Then select which type of material you want the object to be.

To turn on/off fog - Pull up the menu and select "toggle fog".

To change the type of fog - Pull up the menu and select "fog type". A submeny will appear. Then select the type of fog you want.

To quit - pull up the menu and select "quit".

Download the Executable (This .exe file is fine, but be sure to check all executables with virus protection.)

Windows

Unix