Skip to content

An OpenGL project which which illuminates a sphere using three distinct light sources. Users can dynamically adjust the light's color and the sphere's material, offering a hands-on experience in visualizing varied lighting conditions.

Notifications You must be signed in to change notification settings

vmsaif/openGL-sphere-lighting-program

Repository files navigation

OpenGL Sphere Lighting

Hits

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.

Features

  • 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.

Requirements

This Repository

Clone this repository to your local machine with:

git clone https://github.com/vmsaif/openGL-sphere-lighting-program

Visual Studio

Ensure you have Visual Studio installed. If not, download it from Visual Studio Official Website.

GLUT Library

This project requires the OpenGL library or glut.h. The easiest way to set it up in Visual Studio is as follows:

  1. Go to the directory where you cloned the project.
  2. Open the openGL-sphere-lighting-program.sln file to open the project in Visual Studio.
  3. Click on Project in the menu bar.
  4. Select Manage NuGet Packages.
  5. Click on the "Browse" tab.(If you don't see it, close the VS window, then resume from step 2.)
  6. Search for "freeglut".
  7. Select "nupengl.core" (which includes glut.h) and click Install.(If already installed, then uninstall then install again).

Interactions

  • Right-click: Activates the menu system.
  • Menu Options: Allows for the selection of light colors, light sources, and sphere materials.

Credits

This project was developed using OpenGL's extensive lighting features to provide a realistic and interactive experience for users interested in graphics programming.

About

An OpenGL project which which illuminates a sphere using three distinct light sources. Users can dynamically adjust the light's color and the sphere's material, offering a hands-on experience in visualizing varied lighting conditions.

Topics

Resources

Stars

Watchers

Forks

Languages