# greyvoidbloom/handsim architecture

> Architecture diagram of the GitHub repository greyvoidbloom/handsim, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/greyvoidbloom/handsim
- Repository: https://github.com/greyvoidbloom/handsim

## Overview

##### Main Components

A. Input Processing Layer:
- Hand Detection Module (Python-based)
- Camera Input System
- Hand Tracking Processing

B. 3D Rendering System:
- OpenGL-based Cube Renderer (C++ implementation)
- GLFW Window Management
- Glad OpenGL Loader

C. Python Visualization:
- Python-based Cube Visualization System

##### Component Relationships

- Data flow from camera input → hand detection → cube manipulation
- OpenGL rendering pipeline
- Interface between hand tracking and cube rendering

##### Specific Implementation Details

For the C++ Implementation:
**[Camera Input] → [Hand Detection System] → [Gesture Processing]**
- ↓
**[GLFW Window Manager] ← [OpenGL Renderer] ← [Cube State Manager]**
- ↑
- [GLAD Loader]

For the Python Implementation:
**[Hand Detection Module] → [Python Visualization] → [Cube Renderer]**

##### Key Elements to Highlight

a. Cross-Language Integration:
- How Python and C++ components interact
- Data exchange mechanisms

b. Graphics Pipeline:
- OpenGL initialization and setup
- Rendering loop and window management
- Shader management (if applicable)

c. Input Processing:
- Camera data flow
- Hand detection processing
- Gesture recognition system

##### Technical Stack Representation

Technologies:
- OpenGL (via GLAD)
- GLFW for window management
- Python for hand detection
- C++ for core rendering
- Any relevant computer vision libraries

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        Camera["Camera Input"]
        HandDetect["Hand Detection Module"]:::python
        GestureProc["Gesture Processing"]
    end

    subgraph "Graphics Pipeline"
        GLFW["GLFW Window Manager"]:::cpp
        GLAD["GLAD OpenGL Loader"]:::cpp
        OpenGL["OpenGL Renderer"]:::cpp
        CubeState["Cube State Manager"]:::cpp
    end

    subgraph "Python Implementation"
        PyViz["Python Visualization"]:::python
        PyCube["Python Cube Renderer"]:::python
    end

    %% Relationships
    Camera --> HandDetect
    HandDetect --> GestureProc
    GestureProc --> CubeState
    
    GLAD --> GLFW
    CubeState --> OpenGL
    OpenGL --> GLFW
    
    HandDetect --> PyViz
    PyViz --> PyCube

    %% Styling
    classDef cpp fill:#90EE90,stroke:#333,stroke-width:2px
    classDef python fill:#B19CD9,stroke:#333,stroke-width:2px
    classDef external fill:#FFB366,stroke:#333,stroke-width:2px

    %% Click events
    click HandDetect "https://github.com/greyvoidbloom/HandSim/blob/main/hand detection/hand_detection.py"
    click OpenGL "https://github.com/greyvoidbloom/HandSim/blob/main/cube simulation/main.cpp"
    click GLFW "https://github.com/greyvoidbloom/HandSim/blob/main/cube simulation/dependencies/include/GLFW/glfw3.h"
    click GLAD "https://github.com/greyvoidbloom/HandSim/blob/main/cube simulation/dependencies/include/glad/glad.h"
    click PyViz "https://github.com/greyvoidbloom/HandSim/blob/main/pyCubeSim/vizCube.py"

    %% Legend
    subgraph Legend
        CPP["C++ Components"]:::cpp
        PY["Python Components"]:::python
        EXT["External Components"]:::external
    end
```
