{"id":26742244,"url":"https://github.com/ka-iden/demoproject","last_synced_at":"2026-05-18T03:10:09.099Z","repository":{"id":284869518,"uuid":"956312220","full_name":"ka-iden/DemoProject","owner":"ka-iden","description":"DemoProject","archived":false,"fork":false,"pushed_at":"2025-03-28T04:19:58.000Z","size":7914,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-28T02:51:48.932Z","etag":null,"topics":["glfw","java","joml","opengl","shadowjar"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ka-iden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-28T03:31:43.000Z","updated_at":"2025-05-28T18:49:40.000Z","dependencies_parsed_at":"2025-03-28T05:33:16.624Z","dependency_job_id":null,"html_url":"https://github.com/ka-iden/DemoProject","commit_stats":null,"previous_names":["ka-iden/demoproject"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ka-iden/DemoProject","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ka-iden%2FDemoProject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ka-iden%2FDemoProject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ka-iden%2FDemoProject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ka-iden%2FDemoProject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ka-iden","download_url":"https://codeload.github.com/ka-iden/DemoProject/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ka-iden%2FDemoProject/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001982,"owners_count":26083243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["glfw","java","joml","opengl","shadowjar"],"created_at":"2025-03-28T06:17:12.520Z","updated_at":"2025-10-09T19:11:29.544Z","avatar_url":"https://github.com/ka-iden.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DemoProject\n\n## Overview\nMy demo project is a rough Java-based 3D OpenGL application that demonstrates a dynamic rendering system. It features a moving camera and a programmable list of cubes that can be dynamically created, positioned, and optionally rotated. The project showcases the use of modern Java features, OpenGL, and basic object-oriented programming principles.\n\n## How to Run\n1. Ensure you have Java 17 or higher installed.\n2. Clone the repository or download the project files.\n3. Navigate to the project directory and build the project using Gradle:\n  - Windows:\n    ```sh\n    ./gradlew.bat build\n    ./gradlew.bat shadowJar\n    ```\n   - Mac/Linux:\n     ```sh\n     ./gradlew build\n     ./gradlew shadowJar\n     ```\n4. Navigate to `./app/build/libs` ([here](./app/build/libs/)) and open a terminal and run `java -jar app-all.jar`\n\nPrebuilt JARs are available in the on my github [here](https://github.com/ka-iden/DemoProject/releases/latest). You can run it the same way as step 4, but without having to navigate to the folder listed above.\n\n## Controls\n- WASD movement, alongside Q and E to move up and down.\n- The amount of cubes can be changed with the **+** (plus, its the same key as the equals sign) and **-** (minus) keys to create or delete the latest cube.\n\n## Features\n- **3D Rendering**: Uses OpenGL to render a 3D scene with cubes.\n- **Dynamic Cube Management**: Add or remove cubes dynamically during runtime using + and - keys.\n- **Camera System**: Move the camera using keyboard and mouse inputs (WASD to move, QE to go up and down).\n- **Wireframe Mode**: Toggle between wireframe and solid rendering modes (Tab key).\n\n## Technologies Used\n- **Java**: Core programming language.\n  - **LWJGL**: Lightweight Java Game Library for OpenGL bindings.\n  - **JOML**: Java OpenGL Math Library for matrix and vector operations.\n- **Gradle**: Build tool for dependency management and project compilation.\n  - JohnRengleman's **Gradle Shadow Plugin**: For creating a shadow JAR with all dependencies included.\n\n## App Structure\n### **Main Application (App.java)**\n- **Variables**:\n  - `window`, `camera`, `shader`: Instances of custom classes.\n  - `vao`, `vbo`, `ebo`: OpenGL arrays to be passed onto the renderer.\n  - `cubeList`: Variablly allocated list of cubes in the scene.\n- **Functions**:\n  - `run`: Initializes the application and starts the main loop.\n  - `bindArrays`: Sets up OpenGL buffers for rendering.\n  - `loop`: Main rendering loop that updates the scene and handles input.\n  - `main`: Entry point of the application, handles user input for the window title.\n### **Camera Class**\n- **Variables**:\n  - `radius`: Distance from the origin.\n  - `azimuth` and `elevation`: Angles for spherical coordinates.\n  - `position`: Current position of the camera.\n  - `sensitivity` and `moveSpeed`: Control mouse and keyboard input responsiveness.\n  - `createCube` and `deleteCube`: Flags for adding or removing cubes.\n- **Functions**:\n  - `handleMouseInput`: Processes mouse input for camera rotation.\n  - `handleKeyboardInput`: Processes keyboard input for movement and cube management.\n  - `getViewMatrix`: Generates the view matrix for rendering the scene.\n### **Cube Class**\n- **Variables**:\n  - `position`: Position of the cube in the 3D space.\n  - `shouldRotate`: Determines if the cube rotates.\n  - `vertices` and `indices`: Shared static arrays for cube geometry.\n- **Functions**:\n  - `getModelMatrix`: Generates the model matrix for the cube, applying transformations like translation and rotation.\n### **Shader Class**\n- **Variables**:\n  - `programId`: OpenGL program ID for the shader.\n  - `vertexShaderCode` and `fragmentShaderCode`: Hardcoded shader source code.\n- **Functions**:\n  - `use`: Activates the shader program.\n  - `setUniformMatrix4fv`: Sets uniform matrix variables in the shader.\n  - `cleanup`: Deletes the shader program.\n  - `createShader`: Compiles and links shader code.\n### **Window Class**\n- **Variables**:\n  - `width`, `height`, `title`: Window dimensions and title.\n  - `window`: GLFW window handle.\n  - `wireframe`: Toggles wireframe rendering mode.\n- **Functions**:\n  - `init`: Initializes the GLFW window and OpenGL context.\n  - `update`: Swaps buffers and polls events.\n  - `cleanup`: Frees resources and destroys the window.\n  - `getAspect`: Returns the aspect ratio for the projection matrix.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fka-iden%2Fdemoproject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fka-iden%2Fdemoproject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fka-iden%2Fdemoproject/lists"}