This repository contains a collection of OpenGL-based computer graphics projects developed for the Computer Graphics and Visual Computing course. Each project demonstrates fundamental to advanced rendering concepts using OpenGL, GLUT, and C++.
Lab 3: Renders a smiley face using immediate mode (glBegin/glEnd) with basic keyboard controls (WASD) and mouse clicks to change eye color.
Lab 4: Reimplements the smiley face using vertex arrays and glVertexPointer, improving performance and separating geometry data from logic. Maintains same interactivity as Lab 3 with added movement control (arrow keys).
Lab 5: Optimizes rendering further with Vertex Buffer Objects (VBOs) and Vertex Array Objects (VAOs). Keeps movement and mouse interactivity but introduces modular functions (initVBOs(), createVAO(), etc.) for better structure and scalability.
Lab 6: Renders a rotating octahedron illuminated by three colored spotlights (red, green, and blue), with interactive 3D camera controls. This program uses smooth camera movement, spotlight directionality, and real-time lighting effects to enhance visual realism.
Camera Movement (Smooth/Continuous):
- W / S – Move forward / backward
- A / D – Move left / right
- Q / E – Move down / up
Other Controls:
- ESC – Exit the program
Visual Features:
- Rotating Octahedron – Automatically spins horizontally
- Three Spotlights – Red, green, and blue lights with directional focus and realistic attenuation
- Smooth Camera Control – Movement is velocity-based for fluid transitions in 3D space
Renders a dynamic 3D solar scene featuring Earth, Moon, background stars, and an Among Us character using OpenGL. Implements object transformations (translation, rotation, scaling), VBOs, and full-screen rendering. Designed for interactive visualization with animated motion, real-time controls, and a stylized space environment.
W/A/S/D
– Move the Among Us characterMouse Scroll
– Scale the Earth objectLeft Mouse Button
– Rotate the MoonESC
– Exit the program
Video Demo: https://youtu.be/HNalhw2L8Jk
git clone https://github.com/jayelcee/Computer-Graphics-Projects.git
cd Computer-Graphics-Projects
sudo apt-get update
sudo apt-get install g++ freeglut3-dev libglew-dev
- Install Xcode Command Line Tools:
xcode-select --install
- Or use Homebrew:
brew install glew
- Install FreeGLUT
- Configure your compiler (e.g., MinGW or MSVC) to include FreeGLUT and GLEW headers and libraries.
-
From the root directory of the repository, compile any
.cpp
file. For example, to compile and runCG_lab1.cpp
:g++ CG_lab1.cpp -o CG_lab1 -lGL -lGLU -lglut ./CG_lab1 ./CG_lab2 ./CG_lab3 ./CG_lab4
g++ CG_lab5.cpp -o CG_lab5 -lGL -lGLU -lglut -lGLEW ./CG_lab5
-
Replace
CG_lab1.cpp
with the filename of the project you want to run.
g++ CG_project.cpp -o CG_project -lGL -lGLU -lglut -lGLEW
./CG_project
This project is open-source and available under the MIT License.