# yidachen07-ux/3d-project architecture

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

- Interactive diagram: https://gitdiagram.com/yidachen07-ux/3d-project
- Repository: https://github.com/yidachen07-ux/3d-project

## Overview

This is a small C++ 3D rendering application. Its visible workflow starts in `src/3Dproject.cpp`: create a window, load an OBJ model, repeatedly process input and render, then present the framebuffer through SDL. The active frame renderer is ray tracing; the code also includes triangle rasterization and PPM export, though neither is called in the shown loop. The README is empty, so capabilities and relationships beyond the sampled code and source index are not documented.

Main entry points: [`include/Window.h`](https://github.com/yidachen07-ux/3d-project/blob/main/include/Window.h) (Window & Input), [`include/Framebuffer.h`](https://github.com/yidachen07-ux/3d-project/blob/main/include/Framebuffer.h) (Framebuffer), [`include/Raytracer.h`](https://github.com/yidachen07-ux/3d-project/blob/main/include/Raytracer.h) (Raytracer), [`include/Model.h`](https://github.com/yidachen07-ux/3d-project/blob/main/include/Model.h) (OBJ Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_main["App Entry<br/>[3Dproject.cpp]"]
  node_window["Window &amp; Input<br/>[Window.h]"]
end

subgraph group_render["Rendering"]
  node_framebuffer["Framebuffer<br/>[Framebuffer.h]"]
  node_raytracer["Raytracer<br/>[Raytracer.h]"]
end

subgraph group_core["3D Core"]
  node_model["OBJ Model<br/>[Model.h]"]
  node_geometry["Geometry<br/>[Geometry.h]"]
  node_math["Math<br/>[Math.h]"]
end

node_user(("User"))
node_sdl["SDL"]

node_user -->|"provides input"| node_window
node_main -->|"creates"| node_window
node_main -->|"loads OBJ"| node_model
node_main -->|"runs loop"| node_window
node_window -->|"uses SDL"| node_sdl
node_window -->|"clears"| node_framebuffer
node_window -->|"renders frame"| node_raytracer
node_window -->|"presents pixels"| node_framebuffer
node_raytracer -->|"writes pixels"| node_framebuffer
node_raytracer -->|"tests sphere rays"| node_geometry
node_framebuffer -->|"rasterizes triangles"| node_geometry
node_framebuffer -->|"uses vectors"| node_math
node_geometry -->|"uses vectors"| node_math
node_model -->|"stores triangles"| node_geometry
node_model -->|"uses vectors"| node_math
node_raytracer -->|"uses transforms"| node_math
node_window -->|"owns model"| node_model

click node_main "https://github.com/yidachen07-ux/3d-project/blob/main/src/3Dproject.cpp"
click node_window "https://github.com/yidachen07-ux/3d-project/blob/main/include/Window.h"
click node_framebuffer "https://github.com/yidachen07-ux/3d-project/blob/main/include/Framebuffer.h"
click node_raytracer "https://github.com/yidachen07-ux/3d-project/blob/main/include/Raytracer.h"
click node_model "https://github.com/yidachen07-ux/3d-project/blob/main/include/Model.h"
click node_geometry "https://github.com/yidachen07-ux/3d-project/blob/main/include/Geometry.h"
click node_math "https://github.com/yidachen07-ux/3d-project/blob/main/include/Math.h"

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_main,node_window,node_user toneBlue
class node_framebuffer,node_raytracer toneAmber
class node_model,node_geometry,node_math toneMint
class node_sdl toneIndigo
```

## Components

### Application

- [App Entry](https://github.com/yidachen07-ux/3d-project/blob/main/src/3Dproject.cpp): `src/3Dproject.cpp`
- [Window & Input](https://github.com/yidachen07-ux/3d-project/blob/main/include/Window.h): `include/Window.h`

### Rendering

- [Framebuffer](https://github.com/yidachen07-ux/3d-project/blob/main/include/Framebuffer.h): `include/Framebuffer.h`
- [Raytracer](https://github.com/yidachen07-ux/3d-project/blob/main/include/Raytracer.h): `include/Raytracer.h`

### 3D Core

- [OBJ Model](https://github.com/yidachen07-ux/3d-project/blob/main/include/Model.h): `include/Model.h`
- [Geometry](https://github.com/yidachen07-ux/3d-project/blob/main/include/Geometry.h): `include/Geometry.h`
- [Math](https://github.com/yidachen07-ux/3d-project/blob/main/include/Math.h): `include/Math.h`

### Other components

- **User**
- **SDL**

## Connections

- User → Window & Input: provides input (evidence: `include/Window.h`)
- App Entry → Window & Input: creates (evidence: `src/3Dproject.cpp`)
- App Entry → OBJ Model: loads OBJ (evidence: `src/3Dproject.cpp`)
- App Entry → Window & Input: runs loop (evidence: `src/3Dproject.cpp`)
- Window & Input → SDL: uses SDL (evidence: `include/Window.h`)
- Window & Input → Framebuffer: clears (evidence: `include/Window.h`)
- Window & Input → Raytracer: renders frame (evidence: `include/Window.h`)
- Window & Input → Framebuffer: presents pixels (evidence: `include/Window.h`)
- Raytracer → Framebuffer: writes pixels (evidence: `include/Raytracer.h`)
- Raytracer → Geometry: tests sphere rays (evidence: `include/Raytracer.h`)
- Framebuffer → Geometry: rasterizes triangles (evidence: `include/Framebuffer.h`)
- Framebuffer → Math: uses vectors (evidence: `include/Framebuffer.h`)
- Geometry → Math: uses vectors (evidence: `include/Geometry.h`)
- OBJ Model → Geometry: stores triangles (evidence: `include/Model.h`)
- OBJ Model → Math: uses vectors (evidence: `include/Model.h`)
- Raytracer → Math: uses transforms (evidence: `include/Raytracer.h`)
- Window & Input → OBJ Model: owns model (evidence: `include/Window.h`)
