This project showcases the lighting capabilities of OpenGL by illuminating a sphere using three distinct light sources. The user can interactively select the color of the light and the material of the sphere, offering a dynamic experience to visualize the effects of different lighting conditions.
- Three Light Sources: Originating from the top left corner, top right corner, and directly behind the viewer.
- Dynamic Light Colors: Choose from white, red, blue, or green light for each light source.
- Material Selection: Three different surface materials can be applied to the sphere.
- Interactive Menu: A right-click menu system for easy selection of lighting elements and materials.
- Sphere Rendering: Utilizes the
glutSolidSphere
command for accurate sphere representation.
Clone this repository to your local machine with:
git clone https://github.com/vmsaif/openGL-sphere-lighting-program
Ensure you have Visual Studio installed. If not, download it from Visual Studio Official Website.
This project requires the OpenGL library or glut.h
. The easiest way to set it up in Visual Studio is as follows:
- Go to the directory where you cloned the project.
- Open the
openGL-sphere-lighting-program.sln
file to open the project in Visual Studio. - Click on
Project
in the menu bar. - Select
Manage NuGet Packages
. - Click on the "Browse" tab.(If you don't see it, close the VS window, then resume from step 2.)
- Search for "freeglut".
- Select "nupengl.core" (which includes glut.h) and click
Install
.(If already installed, then uninstall then install again).
- Right-click: Activates the menu system.
- Menu Options: Allows for the selection of light colors, light sources, and sphere materials.
This project was developed using OpenGL's extensive lighting features to provide a realistic and interactive experience for users interested in graphics programming.