# javicone/galeriafotos architecture

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

- Interactive diagram: https://gitdiagram.com/javicone/galeriafotos
- Repository: https://github.com/javicone/galeriafotos

## Overview

##### Project type and purpose
- This is a single‐repo Godot Engine (v4.x) 3D application written in GDScript.
- Purpose: take a folder of user-provided images, analyze their dimensions, and procedurally build a first-person 3D art gallery with correctly sized picture frames.

##### File structure
- Top level:
- project.godot – Godot project entry
- .gitignore*/.gitattributes – source control metadata
- README.txt – project description
- Camera3D.gd, ControladorCuadros.gd, controlador_imagenes.gd – standalone scripts
- addons/… – Godot Git Plugin for editor integration
- “assets/” & “textures/” – 3D models and texture source files
- “escenas/” – all .tscn scene files and corresponding GDScript controllers
- “personaje_asset/” – imported rigid character body plugin with example scenes
- “example/” – minimal example scene to demonstrate character controls

##### Extract key insights from the README
- The user drops images into a folder → system auto-analyzes → gallery built in real time.
- First-person navigation (WASD + mouse).
- Modular, dynamic gallery construction; image proportions drive frame sizes.

##### Main components
a. User Input (File System)
b. Image Loader & Analyzer (controlador_imagenes.gd)
c. Gallery Builder / Scene Controller (ControladorCuadros.gd, ControladoEscenas.gd)
d. Godot Scene Graph (escenas/*.tscn)
e. Player Controller (Camera3D.gd + personaje_asset scripts)
f. Asset Manager (loading assets/models/textures)
g. Render Engine (Godot Core)
h. Editor Addon (godot-git-plugin) – development-time only

##### Relationships & data flow
- User drops images → Image Loader reads files → Analyzer extracts width/height → Gallery Builder spawns frame nodes with proportional scaling → Scene Graph updates → Render Engine draws frames, floor, walls → Player Controller handles user input & camera moves → continuous Render loop.
- Asset Manager services the Builder and the Player by loading meshes, materials, textures.
- Editor Addon plugs into Godot Editor, does not participate at runtime.

##### Architectural patterns & principles
- Modular scene-based architecture: each functional area lives in its own scene (.tscn) + script.
- Separation of concerns:
- File I/O & analysis (controlador_imagenes.gd)
- Scene construction (ControladorCuadros.gd)
- Input handling (Camera3D.gd + character plugin)
- Event/driven initialization: on game start the loader fires, then builder subscribes.

##### Detailed checklist
- .tscn scenes are represented (mainEscena, paredCuadro, suelo, etc.) under “Scene Graph.”
- Asset folders feeding into an Asset Manager block.
- Feedback loop: user input → camera movement → continuous rendering.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Entry Point
    EntryPoint["project.godot"]:::scene
    EntryPoint -->|launches| MainScene

    %% Data Ingestion
    subgraph "Data Ingestion"
        FS["textures/imagenes"]:::fileSystem
        Analyzer["Image Loader & Analyzer\n(controlador_imagenes.gd)"]:::script
    end
    FS -->|reads images| Analyzer

    %% Asset Management
    subgraph "Asset Manager"
        Assets["assets/"]:::fileSystem
        Materials["materiales/materialPaed.tres"]:::fileSystem
        Textures["textures/"]:::fileSystem
    end

    Assets -->|provides models/textures| Builder
    Materials -->|provides material| Builder
    Textures -->|provides textures| Builder

    %% Scene Generation
    subgraph "Scene Generation"
        Builder["Gallery Builder\n(ControladorCuadros.gd)"]:::script
        SceneController["Scene Controller\n(ControladoEscenas.gd)"]:::script
        Builder -->|spawns frames| SceneGraph
        SceneController -->|manages scenes| SceneGraph

        subgraph "Scene Graph"
            MainScene["mainEscena.tscn"]:::scene
            Galeria["Galeria.tscn"]:::scene
            Pared["pared.tscn"]:::scene
            ParedVacia["pared_vacia.tscn"]:::scene
            Suelo["Suelo.tscn"]:::scene
            Techo["techoEscena.tscn"]:::scene
            EjemploPersonaje["ejemploPersonaje.tscn"]:::scene
            Personaje["personaje.tscn"]:::scene
            Escenario["escenario.tscn"]:::scene
            PantallaCargaScene["pantallaCarga.tscn"]:::scene
        end
    end

    %% Runtime Engine
    subgraph "Runtime Engine"
        Engine["Godot Engine (Core)"]:::engine
        SceneGraph -->|renders| Engine
    end

    %% Player Controller
    subgraph "Player Controller"
        Camera["Camera3D.gd"]:::script
        RigidExample["rigid_player.tscn\n(example)"]:::scene
        RigidScript["rigid_player.gd\n(example)"]:::script
        PluginExample["rigid_player.tscn\n(plugin)"]:::scene
        PluginScript["rigid_player.gd\n(plugin)"]:::script
    end
    Engine -->|process input| Camera
    Engine -->|process input| RigidExample
    Engine -->|process input| PluginExample

    Camera -->|moves camera| Engine

    %% Dev Tools
    subgraph "Development Tools"
        GitPlugin["godot-git-plugin\n(addons/)"]:::dev
    end

    %% Control Flow
    Analyzer -->|sends dimensions| Builder

    EntryPoint -->|loads| MainScene
    MainScene -->|contains| SceneController
    MainScene -->|contains| Builder

    SceneGraph -->|interacts| Engine
    Camera -->|controls| SceneGraph

    %% Click Events
    click FS "https://github.com/javicone/galeriafotos/tree/main/textures/imagenes"
    click Analyzer "https://github.com/javicone/galeriafotos/blob/main/controlador_imagenes.gd"
    click Builder "https://github.com/javicone/galeriafotos/blob/main/ControladorCuadros.gd"
    click SceneController "https://github.com/javicone/galeriafotos/blob/main/escenas/ControladoEscenas.gd"
    click MainScene "https://github.com/javicone/galeriafotos/blob/main/escenas/mainEscena.tscn"
    click Galeria "https://github.com/javicone/galeriafotos/blob/main/escenas/Galeria.tscn"
    click Pared "https://github.com/javicone/galeriafotos/blob/main/escenas/pared.tscn"
    click ParedVacia "https://github.com/javicone/galeriafotos/blob/main/escenas/pared_vacia.tscn"
    click Suelo "https://github.com/javicone/galeriafotos/blob/main/escenas/Suelo.tscn"
    click Techo "https://github.com/javicone/galeriafotos/blob/main/escenas/techoEscena.tscn"
    click EjemploPersonaje "https://github.com/javicone/galeriafotos/blob/main/escenas/ejemploPersonaje.tscn"
    click Personaje "https://github.com/javicone/galeriafotos/blob/main/escenas/personaje.tscn"
    click Escenario "https://github.com/javicone/galeriafotos/blob/main/escenas/escenario.tscn"
    click PantallaCargaScene "https://github.com/javicone/galeriafotos/blob/main/escenas/pantallaCarga.tscn"
    click Camera "https://github.com/javicone/galeriafotos/blob/main/Camera3D.gd"
    click RigidExample "https://github.com/javicone/galeriafotos/blob/main/example/rigid_player.tscn"
    click RigidScript "https://github.com/javicone/galeriafotos/blob/main/example/rigid_player.gd"
    click PluginExample "https://github.com/javicone/galeriafotos/blob/main/personaje_asset/rigid_character_body_3d-*/example/rigid_player.tscn"
    click PluginScript "https://github.com/javicone/galeriafotos/blob/main/personaje_asset/rigid_character_body_3d-*/example/rigid_player.gd"
    click Assets "https://github.com/javicone/galeriafotos/tree/main/assets/"
    click Materials "https://github.com/javicone/galeriafotos/blob/main/materiales/materialPaed.tres"
    click Textures "https://github.com/javicone/galeriafotos/tree/main/textures/"
    click GitPlugin "https://github.com/javicone/galeriafotos/tree/main/addons/godot-git-plugin/"

    %% Styles
    classDef scene fill:#D0E6FA,stroke:#0366D6,color:#0366D6;
    classDef script fill:#E6F4EA,stroke:#22863A,color:#22863A;
    classDef fileSystem fill:#FFE8A1,stroke:#D29922,color:#8A4500;
    classDef engine fill:#F0F3F5,stroke:#57606A,color:#57606A;
    classDef dev fill:#F5F0FF,stroke:#6F42C1,color:#6F42C1;
```
