# chinmay0303/15_opengl architecture

> Architecture diagram of the GitHub repository chinmay0303/15_opengl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chinmay0303/15_opengl
- Repository: https://github.com/chinmay0303/15_opengl

## Overview

This repository is a sequence of OpenGL learning demos, progressing from window setup and primitive drawing through shaders, transforms, cameras, model loading, lighting, and slicing. The main workflow is to run a lesson and interact with its rendered scene. The tree and excerpts show several later demos split into world, view, projection, and domain helpers; links below are limited to relationships visible in the source index or excerpts. The README only names the repository, so it does not document additional capabilities.

Main entry points: [`28_Volume_Slicing/main.cpp`](https://github.com/chinmay0303/15_opengl/blob/main/28_Volume_Slicing/main.cpp) (Volume Slicing), [`23_Camera_Movement/main.cpp`](https://github.com/chinmay0303/15_opengl/blob/main/23_Camera_Movement/main.cpp) (Camera Movement), [`24_WVP/main.cpp`](https://github.com/chinmay0303/15_opengl/blob/main/24_WVP/main.cpp) (WVP Demo), [`25_OFF_Reader/main.cpp`](https://github.com/chinmay0303/15_opengl/blob/main/25_OFF_Reader/main.cpp) (OFF Model Viewer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_basics["OpenGL Basics"]
  node_window["Window Setup<br/>[main.cpp]"]
  node_primitives["Primitive Drawing<br/>[main.cpp]"]
  node_shaders["Shaders and Uniforms<br/>[main.cpp]"]
end

subgraph group_transforms["Transforms and Cameras"]
  node_transforms_demo["Transform Demos<br/>[main.cpp]"]
  node_projection["Perspective Projection<br/>[main.cpp]"]
  node_camera_space["Camera Space<br/>[main.cpp]"]
  node_camera_move["Camera Movement<br/>[main.cpp]"]
  node_camera_impl["Camera Controls<br/>[camera.cpp]"]
  node_wvp_demo["WVP Demo<br/>[main.cpp]"]
  node_wvp_parts["WVP Components"]
end

subgraph group_models["Models and Lighting"]
  node_off_demo["OFF Model Viewer<br/>[main.cpp]"]
  node_off_reader["OFF Mesh Reader<br/>[offreader.h]"]
  node_lighting["Lighting Demo<br/>[main.cpp]"]
  node_lighting_reader["Lighting Mesh Reader<br/>[offreader.h]"]
end

subgraph group_slicing["Slicing and Volumes"]
  node_mesh_slicing["Mesh Slicing<br/>[main.cpp]"]
  node_slice_logic["Slice Logic<br/>[slicing.cpp]"]
  node_volume_demo["Volume Slicing<br/>[main.cpp]"]
  node_volume_data["Volume Data<br/>[volume.cpp]"]
  node_colourmap["Colour Mapping<br/>[colourmap.cpp]"]
end

subgraph group_engine["Shared Math"]
  node_math["Vector and Matrix Math<br/>[ogldev_math_3d.h]"]
  node_pipeline["Transform Pipeline<br/>[pipeline.cpp]"]
end

node_learner(("Learner"))

node_learner -.->|"runs demo"| node_window
node_learner -.->|"runs demo"| node_primitives
node_learner -.->|"runs demo"| node_shaders
node_learner -.->|"runs demo"| node_transforms_demo
node_learner -.->|"runs demo"| node_projection
node_learner -.->|"runs demo"| node_camera_space
node_learner -.->|"runs demo"| node_camera_move
node_learner -.->|"runs demo"| node_wvp_demo
node_learner -.->|"runs demo"| node_off_demo
node_learner -.->|"runs demo"| node_lighting
node_learner -.->|"runs demo"| node_mesh_slicing
node_learner -.->|"runs demo"| node_volume_demo
node_camera_move -->|"uses controls"| node_camera_impl
node_wvp_demo -->|"uses components"| node_wvp_parts
node_off_demo -->|"uses reader"| node_off_reader
node_lighting -->|"uses reader"| node_lighting_reader
node_mesh_slicing -->|"uses slicing"| node_slice_logic
node_volume_demo -->|"uses volume"| node_volume_data
node_volume_demo -->|"uses colormap"| node_colourmap
node_pipeline -->|"uses math"| node_math

click node_window "https://github.com/chinmay0303/15_opengl/blob/main/01_window/main.cpp"
click node_primitives "https://github.com/chinmay0303/15_opengl/blob/main/05_triangle/main.cpp"
click node_shaders "https://github.com/chinmay0303/15_opengl/blob/main/07_Shaders/main.cpp"
click node_transforms_demo "https://github.com/chinmay0303/15_opengl/blob/main/18_Transforms/main.cpp"
click node_projection "https://github.com/chinmay0303/15_opengl/blob/main/21_Perspective_Projection/main.cpp"
click node_camera_space "https://github.com/chinmay0303/15_opengl/blob/main/22_Camera_Space/main.cpp"
click node_camera_move "https://github.com/chinmay0303/15_opengl/blob/main/23_Camera_Movement/main.cpp"
click node_camera_impl "https://github.com/chinmay0303/15_opengl/blob/main/23_Camera_Movement/camera.cpp"
click node_wvp_demo "https://github.com/chinmay0303/15_opengl/blob/main/24_WVP/main.cpp"
click node_wvp_parts "https://github.com/chinmay0303/15_opengl/tree/main/24_WVP"
click node_off_demo "https://github.com/chinmay0303/15_opengl/blob/main/25_OFF_Reader/main.cpp"
click node_off_reader "https://github.com/chinmay0303/15_opengl/blob/main/25_OFF_Reader/offreader.h"
click node_lighting "https://github.com/chinmay0303/15_opengl/blob/main/26_Lighting/main.cpp"
click node_lighting_reader "https://github.com/chinmay0303/15_opengl/blob/main/26_Lighting/offreader.h"
click node_mesh_slicing "https://github.com/chinmay0303/15_opengl/blob/main/27_Slicing/main.cpp"
click node_slice_logic "https://github.com/chinmay0303/15_opengl/blob/main/27_Slicing/slicing.cpp"
click node_volume_demo "https://github.com/chinmay0303/15_opengl/blob/main/28_Volume_Slicing/main.cpp"
click node_volume_data "https://github.com/chinmay0303/15_opengl/blob/main/28_Volume_Slicing/volume.cpp"
click node_colourmap "https://github.com/chinmay0303/15_opengl/blob/main/28_Volume_Slicing/colourmap.cpp"
click node_math "https://github.com/chinmay0303/15_opengl/blob/main/Include/ogldev_math_3d.h"
click node_pipeline "https://github.com/chinmay0303/15_opengl/blob/main/Common/pipeline.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_window,node_primitives,node_shaders toneBlue
class node_transforms_demo,node_projection,node_camera_space,node_camera_move,node_camera_impl,node_wvp_demo,node_wvp_parts toneAmber
class node_off_demo,node_off_reader,node_lighting,node_lighting_reader toneMint
class node_mesh_slicing,node_slice_logic,node_volume_demo,node_volume_data,node_colourmap toneRose
class node_math,node_pipeline,node_learner toneIndigo
```

## Components

### OpenGL Basics

- [Window Setup](https://github.com/chinmay0303/15_opengl/blob/main/01_window/main.cpp): `01_window/main.cpp`
- [Primitive Drawing](https://github.com/chinmay0303/15_opengl/blob/main/05_triangle/main.cpp): `05_triangle/main.cpp`
- [Shaders and Uniforms](https://github.com/chinmay0303/15_opengl/blob/main/07_Shaders/main.cpp): `07_Shaders/main.cpp`

### Transforms and Cameras

- [Transform Demos](https://github.com/chinmay0303/15_opengl/blob/main/18_Transforms/main.cpp): `18_Transforms/main.cpp`
- [Perspective Projection](https://github.com/chinmay0303/15_opengl/blob/main/21_Perspective_Projection/main.cpp): `21_Perspective_Projection/main.cpp`
- [Camera Space](https://github.com/chinmay0303/15_opengl/blob/main/22_Camera_Space/main.cpp): `22_Camera_Space/main.cpp`
- [Camera Movement](https://github.com/chinmay0303/15_opengl/blob/main/23_Camera_Movement/main.cpp): `23_Camera_Movement/main.cpp`
- [Camera Controls](https://github.com/chinmay0303/15_opengl/blob/main/23_Camera_Movement/camera.cpp): `23_Camera_Movement/camera.cpp`
- [WVP Demo](https://github.com/chinmay0303/15_opengl/blob/main/24_WVP/main.cpp): `24_WVP/main.cpp`
- [WVP Components](https://github.com/chinmay0303/15_opengl/tree/main/24_WVP): `24_WVP`

### Models and Lighting

- [OFF Model Viewer](https://github.com/chinmay0303/15_opengl/blob/main/25_OFF_Reader/main.cpp): `25_OFF_Reader/main.cpp`
- [OFF Mesh Reader](https://github.com/chinmay0303/15_opengl/blob/main/25_OFF_Reader/offreader.h): `25_OFF_Reader/offreader.h`
- [Lighting Demo](https://github.com/chinmay0303/15_opengl/blob/main/26_Lighting/main.cpp): `26_Lighting/main.cpp`
- [Lighting Mesh Reader](https://github.com/chinmay0303/15_opengl/blob/main/26_Lighting/offreader.h): `26_Lighting/offreader.h`

### Slicing and Volumes

- [Mesh Slicing](https://github.com/chinmay0303/15_opengl/blob/main/27_Slicing/main.cpp): `27_Slicing/main.cpp`
- [Slice Logic](https://github.com/chinmay0303/15_opengl/blob/main/27_Slicing/slicing.cpp): `27_Slicing/slicing.cpp`
- [Volume Slicing](https://github.com/chinmay0303/15_opengl/blob/main/28_Volume_Slicing/main.cpp): `28_Volume_Slicing/main.cpp`
- [Volume Data](https://github.com/chinmay0303/15_opengl/blob/main/28_Volume_Slicing/volume.cpp): `28_Volume_Slicing/volume.cpp`
- [Colour Mapping](https://github.com/chinmay0303/15_opengl/blob/main/28_Volume_Slicing/colourmap.cpp): `28_Volume_Slicing/colourmap.cpp`

### Shared Math

- [Vector and Matrix Math](https://github.com/chinmay0303/15_opengl/blob/main/Include/ogldev_math_3d.h): `Include/ogldev_math_3d.h`
- [Transform Pipeline](https://github.com/chinmay0303/15_opengl/blob/main/Common/pipeline.cpp): `Common/pipeline.cpp`

### Other components

- **Learner**

## Connections

- Learner → Window Setup: runs demo
- Learner → Primitive Drawing: runs demo
- Learner → Shaders and Uniforms: runs demo
- Learner → Transform Demos: runs demo
- Learner → Perspective Projection: runs demo
- Learner → Camera Space: runs demo
- Learner → Camera Movement: runs demo
- Learner → WVP Demo: runs demo
- Learner → OFF Model Viewer: runs demo
- Learner → Lighting Demo: runs demo
- Learner → Mesh Slicing: runs demo
- Learner → Volume Slicing: runs demo
- Camera Movement → Camera Controls: uses controls (evidence: `23_Camera_Movement/main.cpp`)
- WVP Demo → WVP Components: uses components (evidence: `24_WVP/main.cpp`)
- OFF Model Viewer → OFF Mesh Reader: uses reader (evidence: `25_OFF_Reader/main.cpp`)
- Lighting Demo → Lighting Mesh Reader: uses reader (evidence: `26_Lighting/main.cpp`)
- Mesh Slicing → Slice Logic: uses slicing (evidence: `27_Slicing/main.cpp`)
- Volume Slicing → Volume Data: uses volume (evidence: `28_Volume_Slicing/main.cpp`)
- Volume Slicing → Colour Mapping: uses colormap (evidence: `28_Volume_Slicing/main.cpp`)
- Transform Pipeline → Vector and Matrix Math: uses math
