# immohammedsahil/martian architecture

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

- Interactive diagram: https://gitdiagram.com/immohammedsahil/martian
- Repository: https://github.com/immohammedsahil/martian

## Overview

MARTIAN is a native C++/OpenGL cinematic sequence engine: the runtime advances an 84.3-second timeline through orbit, separation, atmospheric entry, and a Martian landing, then presents the finale. The README documents the scene director, camera interpolation, optical post-processing, audio, and optional video export. The sampled main-loop excerpt shows rendering and input handling, while the README supplies several subsystem relationships; unsampled implementation details are not inferred.

Main entry points: [`main.cpp`](https://github.com/immohammedsahil/martian/blob/main/main.cpp) (Runtime Loop), [`SceneDirector.cpp`](https://github.com/immohammedsahil/martian/blob/main/SceneDirector.cpp) (Scene Director), [`AudioEngine.cpp`](https://github.com/immohammedsahil/martian/blob/main/AudioEngine.cpp) (Audio Engine), [`VideoExporter.cpp`](https://github.com/immohammedsahil/martian/blob/main/VideoExporter.cpp) (Video Exporter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime Control"]
  node_main["Runtime Loop<br/>[main.cpp]"]
  node_director["Scene Director<br/>[SceneDirector.cpp]"]
  node_timing["Timing Editor<br/>[TimingEditor.cpp]"]
end

subgraph group_cinematic["Sequence Scenes"]
  node_scene1["Orbit Scene<br/>[Scene1.cpp]"]
  node_scene2["Separation Scene<br/>[Scene2.cpp]"]
  node_scene3["Entry Scene<br/>[Scene3.cpp]"]
  node_scene4["Dune Scene<br/>[Scene4.cpp]"]
end

subgraph group_visuals["Visual Systems"]
  node_planet["Planet Rendering<br/>[Planet.cpp]"]
  node_starfield["Starfield<br/>[Starfield.cpp]"]
  node_spacecraft["Spacecraft and Particles<br/>[Spacecraft.cpp]"]
  node_post["Optical Post-Processing<br/>[PostProcess.cpp]"]
end

subgraph group_media["Media Output"]
  node_audio["Audio Engine<br/>[AudioEngine.cpp]"]
  node_soundtrack["Track or Synth"]
  node_exporter["Video Exporter<br/>[VideoExporter.cpp]"]
  node_ffmpeg["FFmpeg"]
end

node_viewer(("Viewer"))

node_viewer -->|"starts runtime"| node_main
node_main -->|"advances timeline"| node_director
node_director -->|"selects scene"| node_scene1
node_director -->|"selects scene"| node_scene2
node_director -->|"selects scene"| node_scene3
node_director -->|"selects scene"| node_scene4
node_main -->|"handles timing input"| node_timing
node_main -->|"renders cinema post"| node_post
node_main -->|"updates playback"| node_audio
node_audio -->|"plays track or fallback"| node_soundtrack
node_main -.->|"optionally captures frames"| node_exporter
node_exporter -->|"pipes video"| node_ffmpeg

click node_main "https://github.com/immohammedsahil/martian/blob/main/main.cpp"
click node_director "https://github.com/immohammedsahil/martian/blob/main/SceneDirector.cpp"
click node_timing "https://github.com/immohammedsahil/martian/blob/main/TimingEditor.cpp"
click node_scene1 "https://github.com/immohammedsahil/martian/blob/main/Scene1.cpp"
click node_scene2 "https://github.com/immohammedsahil/martian/blob/main/Scene2.cpp"
click node_scene3 "https://github.com/immohammedsahil/martian/blob/main/Scene3.cpp"
click node_scene4 "https://github.com/immohammedsahil/martian/blob/main/Scene4.cpp"
click node_planet "https://github.com/immohammedsahil/martian/blob/main/Planet.cpp"
click node_starfield "https://github.com/immohammedsahil/martian/blob/main/Starfield.cpp"
click node_spacecraft "https://github.com/immohammedsahil/martian/blob/main/Spacecraft.cpp"
click node_post "https://github.com/immohammedsahil/martian/blob/main/PostProcess.cpp"
click node_audio "https://github.com/immohammedsahil/martian/blob/main/AudioEngine.cpp"
click node_exporter "https://github.com/immohammedsahil/martian/blob/main/VideoExporter.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_main,node_director,node_timing,node_viewer toneBlue
class node_scene1,node_scene2,node_scene3,node_scene4 toneAmber
class node_planet,node_starfield,node_spacecraft,node_post toneMint
class node_audio,node_soundtrack,node_exporter,node_ffmpeg toneRose
```

## Components

### Runtime Control

- [Runtime Loop](https://github.com/immohammedsahil/martian/blob/main/main.cpp): `main.cpp`
- [Scene Director](https://github.com/immohammedsahil/martian/blob/main/SceneDirector.cpp): `SceneDirector.cpp`
- [Timing Editor](https://github.com/immohammedsahil/martian/blob/main/TimingEditor.cpp): `TimingEditor.cpp`

### Sequence Scenes

- [Orbit Scene](https://github.com/immohammedsahil/martian/blob/main/Scene1.cpp): `Scene1.cpp`
- [Separation Scene](https://github.com/immohammedsahil/martian/blob/main/Scene2.cpp): `Scene2.cpp`
- [Entry Scene](https://github.com/immohammedsahil/martian/blob/main/Scene3.cpp): `Scene3.cpp`
- [Dune Scene](https://github.com/immohammedsahil/martian/blob/main/Scene4.cpp): `Scene4.cpp`

### Visual Systems

- [Planet Rendering](https://github.com/immohammedsahil/martian/blob/main/Planet.cpp): `Planet.cpp`
- [Starfield](https://github.com/immohammedsahil/martian/blob/main/Starfield.cpp): `Starfield.cpp`
- [Spacecraft and Particles](https://github.com/immohammedsahil/martian/blob/main/Spacecraft.cpp): `Spacecraft.cpp`
- [Optical Post-Processing](https://github.com/immohammedsahil/martian/blob/main/PostProcess.cpp): `PostProcess.cpp`

### Media Output

- [Audio Engine](https://github.com/immohammedsahil/martian/blob/main/AudioEngine.cpp): `AudioEngine.cpp`
- **Track or Synth**
- [Video Exporter](https://github.com/immohammedsahil/martian/blob/main/VideoExporter.cpp): `VideoExporter.cpp`
- **FFmpeg**

### Other components

- **Viewer**

## Connections

- Viewer → Runtime Loop: starts runtime
- Runtime Loop → Scene Director: advances timeline
- Scene Director → Orbit Scene: selects scene
- Scene Director → Separation Scene: selects scene
- Scene Director → Entry Scene: selects scene
- Scene Director → Dune Scene: selects scene
- Runtime Loop → Timing Editor: handles timing input (evidence: `main.cpp`)
- Runtime Loop → Optical Post-Processing: renders cinema post (evidence: `main.cpp`)
- Runtime Loop → Audio Engine: updates playback
- Audio Engine → Track or Synth: plays track or fallback (evidence: `AudioEngine.cpp`)
- Runtime Loop → Video Exporter: optionally captures frames
- Video Exporter → FFmpeg: pipes video
