This repository contains solutions for the assignments of the CSE 410 - Computer Graphics course. Each assignment focuses on different aspects of computer graphics and includes OpenGL-based implementations. Below is a brief description of each assignment.
- Language: C++
- Graphics Library: OpenGL
- Windowing and Input: GLUT (OpenGL Utility Toolkit)
- Image Output: BMP format
- Development Environment: Any C++ compiler supporting OpenGL (e.g., g++ with OpenGL libraries)
This assignment implements a fully controllable camera system and a gun model, followed by bubble animations. It utilizes OpenGL to achieve basic 3D transformations and interactions.
-
Fully Controllable Camera
- Control movement and rotation of the camera using keyboard keys.
- 6 movement operations and 6 rotation operations.
-
Gun Model
- Model a gun using basic shapes without OpenGL library functions.
- Implement joint rotation and firing mechanics.
-
Bubble Animation
- Simulate bubbles on a 2D plane using vector-based movement and collision handling.
This assignment focuses on drawing and updating 2D Hermite curves. It uses control points to generate curves and allows for dynamic updates.
-
Curve Drawing
- Add control points via left-click and draw a closed 2D Hermite curve with the right-click.
-
Curve Update
- Update existing control points and smoothly animate points along the curve.
-
Geometry Toggle
- Toggle the display of control points and the geometry of the curve using the keyboard.
In this assignment, we develop a simplified version of the raster-based graphics pipeline used in OpenGL. The program generates a BMP image after applying a series of transformations and projections to 3D models.
-
Modeling Transformation
- Parse
scene.txt
to apply scaling, rotation, and translation transformations.
- Parse
-
View Transformation
- Implement camera view transformations using a
gluLookAt
style approach.
- Implement camera view transformations using a
-
Projection Transformation
- Generate projection matrix and perform clipping for the scene.
-
Scan Conversion with Z-buffer
- Apply z-buffer algorithm for rasterizing the triangles in the 3D scene and render them into a BMP image.
This assignment involves building a ray-tracing engine to render images of 3D scenes, considering light interactions such as reflection, diffuse, and specular effects.
-
OpenGL Interface
- Draw 3D objects (sphere, pyramid, checkerboard) in an OpenGL window.
-
Ray Tracing
- Implement ray generation from the camera and perform object intersection calculations.
-
Lighting and Shading
- Calculate ambient, diffuse, and specular components for object shading.
-
Reflection and Recursion
- Implement recursive ray tracing for handling reflections.
-
Spotlight and Distance-Based Light Intensity
- Add spotlights with a cutoff angle and decrease light intensity based on distance.
Each assignment is implemented in C++ using OpenGL. The code is organized into separate directories for each assignment, with their respective source files.
- OpenGL and GLUT libraries
- C++ compiler
- Institution: Bangladesh University of Engineering and Technology (BUET)
- Course: CSE 410 - Computer Graphics