{"id":27854125,"url":"https://github.com/nosfty/cs-sdl3d","last_synced_at":"2026-05-02T06:32:53.113Z","repository":{"id":290641259,"uuid":"975134647","full_name":"nosfty/CS-SDL3D","owner":"nosfty","description":"From Scratch C# SDL RENDERER ","archived":false,"fork":false,"pushed_at":"2025-04-30T14:40:48.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-04T08:58:50.116Z","etag":null,"topics":["3d-graphics","dotnet","from-scratch","math","render","sdl2","vector","vectormath"],"latest_commit_sha":null,"homepage":"","language":"C#","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/nosfty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2025-04-29T20:53:30.000Z","updated_at":"2025-04-30T14:40:52.000Z","dependencies_parsed_at":"2025-04-29T21:39:05.814Z","dependency_job_id":"47196632-4a6e-4b32-b368-9171c917b66f","html_url":"https://github.com/nosfty/CS-SDL3D","commit_stats":null,"previous_names":["nosfty/cs-sdl3d"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nosfty%2FCS-SDL3D","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nosfty%2FCS-SDL3D/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nosfty%2FCS-SDL3D/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nosfty%2FCS-SDL3D/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nosfty","download_url":"https://codeload.github.com/nosfty/CS-SDL3D/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252310962,"owners_count":21727516,"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","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":["3d-graphics","dotnet","from-scratch","math","render","sdl2","vector","vectormath"],"created_at":"2025-05-04T08:58:56.211Z","updated_at":"2026-05-02T06:32:53.078Z","avatar_url":"https://github.com/nosfty.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CS-SDL3D\n## 3D Cube Renderer with SDL2\n\nThis is a simple program for rendering a 3D cube using the SDL2 library in C#. The project demonstrates the basics of 3D graphics, including coordinate transformations, projection, and camera control.\n\n## Features\n\n- Rendering of a rotating 3D cube using SDL2\n- Simple movable camera\n- Mathematics for 3D transformations (rotation, translation, projection)\n- Vector math basics (Vec2, Vec3)\n\n## Controls\n\n- **W/S**: Move camera forward/backward (Z-axis)\n- **A/D**: Move camera left/right (X-axis)\n- **Q/E**: Move camera up/down (Y-axis)\n- **Close window**: Quit the program\n\n## API Overview\n\n### Core Classes\n\n1. **WindowManager** - manages SDL2 window and renderer\n   - `GetRenderer()` - gets the SDL renderer\n   - `ClearBackground()` - clears the screen\n   - `Present()` - displays rendered content\n\n2. **Vec2/Vec3** - classes for 2D and 3D vector operations\n   - Basic operations (+, -, *, /)\n   - Normalization, dot product\n   - Rotation (Vec3 only)\n\n3. **Camera** - simple 3D camera\n   - `WorldToViewSpace()` - transforms world coordinates to camera space\n   - Configurable FOV, near and far clipping planes\n\n4. **Core** - utility functions\n   - `Vec3toVec2()` - projects 3D point to 2D screen\n   - `Rotate()` - rotates vector around axis\n   - `ScreenSpaceToSDLCoords()` - converts normalized coordinates to pixel coordinates\n\n## Building and Running\n\n1. Ensure you have .NET SDK installed (version 5.0 or higher)\n2. Install SDL2 dependencies (via NuGet or manually)\n3. Build the project: `dotnet build`\n4. Run: `dotnet run`\n\n## How to Contribute\n\nAll contributions are welcome! Here are some ideas:\n\n1. **Graphics Improvements**:\n   - Add lighting\n   - Implement filled polygons instead of wireframe\n   - Add texturing\n\n2. **New Features**:\n   - Load 3D models from files\n   - More advanced camera controls (free flight)\n   - Mouse camera control\n\n3. **Optimizations**:\n   - Improve math operations\n   - Add backface culling\n   - More efficient rendering\n\n### Contribution Process\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to your fork (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n### Gallery\n\n![image](https://github.com/user-attachments/assets/b8b276bb-c406-4557-ab44-5554ff99bd11)\n\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnosfty%2Fcs-sdl3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnosfty%2Fcs-sdl3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnosfty%2Fcs-sdl3d/lists"}