{"id":27146176,"url":"https://github.com/pforhan/wannabe","last_synced_at":"2025-04-08T10:09:14.768Z","repository":{"id":137956487,"uuid":"14547654","full_name":"pforhan/wannabe","owner":"pforhan","description":"Multiplatform low-resolution 3d engine.  For losers, by losers.","archived":false,"fork":false,"pushed_at":"2025-02-19T03:46:01.000Z","size":441,"stargazers_count":1,"open_issues_count":12,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-19T04:27:54.695Z","etag":null,"topics":["kotlin","swing","voxel"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/pforhan.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":"2013-11-20T05:30:40.000Z","updated_at":"2025-02-19T03:46:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"9f3cdc23-a40e-472f-984b-59ad07c85f62","html_url":"https://github.com/pforhan/wannabe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pforhan%2Fwannabe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pforhan%2Fwannabe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pforhan%2Fwannabe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pforhan%2Fwannabe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pforhan","download_url":"https://codeload.github.com/pforhan/wannabe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247819947,"owners_count":21001394,"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":["kotlin","swing","voxel"],"created_at":"2025-04-08T10:09:14.099Z","updated_at":"2025-04-08T10:09:14.748Z","avatar_url":"https://github.com/pforhan.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"wannabe\n=======\n\nMultiplatform low-resolution voxel 3d engine.  For losers, by losers.\n\nSummary\n-------\n\u003e [Wikipedia](https://en.wikipedia.org/wiki/Voxel): A voxel represents a value on a regular grid in three-dimensional space.\n\nThis project contains simple 3d data structures and code to support a graphics engine, along with some sample voxel structures and demonstration application.\n\nCode\n----\nHere's a quick overview of how the code represents voxel data\n\n* A `Position` describes a point in 3d Cartesian space, with x, y, and z values.\n* A `Voxel` is a `Position` and an integer value.\n* A `Grid` is a collection of `Voxels`\n\nThen there's how to display these:\n\n* `Translation` is a mutable form of `Position`.\n* A `Camera` keeps track of where we're looking, by translating a grid to its local space.\n* A `Projection` converts a Position to a pixel location, given a Camera and a pixel size.  There's `Flat`, `Cabinet`, and `PseudoPerspective` Projections.\n* A `UI` keeps track of the Grid, the Camera, and the Projection, and actually renders the result in a platform-specific way. The Swing UI implementation uses a variety of `SwingRenderer` classes, seen below.\n\nSamples\n-------\nYou can run SwingWannabe, a Kotlin/Swing implementation that I'm using as my testbed. Run its main method from the IDE, or try `./gradlew swing_demo:run` on the command line. It has a selection of sample grids, along with projection and render mode selections.\n\n**Rotation Video tests (click to play)**\n\n[![Perspective Block Test](https://img.youtube.com/vi/MfYdNTo8nR8/0.jpg)](https://www.youtube.com/watch?v=MfYdNTo8nR8) [![Perspective Circle Test](https://img.youtube.com/vi/bdmP57BH-_A/0.jpg)](https://www.youtube.com/watch?v=bdmP57BH-_A)[![Cabinet Block Test](https://img.youtube.com/vi/s7FAf_rRXvQ/0.jpg)](https://www.youtube.com/watch?v=s7FAf_rRXvQ) [![Interactive Test](https://img.youtube.com/vi/HWenUpl_C-Q/0.jpg)](https://www.youtube.com/watch?v=HWenUpl_C-Q)\n\n**Projection and Render tests (Click for larger views.)**\n\n[![Projections](http://www.muddyhorse.com/wp-content/uploads/2020/05/wannabe-projections.gif)](http://www.muddyhorse.com/wp-content/uploads/2020/05/wannabe-projections-big.gif)\n[![Render Types](http://www.muddyhorse.com/wp-content/uploads/2020/05/wannabe-renders.gif)](http://www.muddyhorse.com/wp-content/uploads/2020/05/wannabe-renders-big.gif)\n\nHeightmap\n---------\n\nOne of the cool sample Grids is a [heightmap](http://en.wikipedia.org/wiki/Heightmap) where shades of gray are translated to height and color and shown as voxels.\n\nGiven this original heightmap:\n\n![Original Heightmap](http://www.muddyhorse.com/wp-content/uploads/2013/11/example-heightmap.png)\n\nThe sample applicaiton renders the upper-left 50x50 pixels of the heightmap as voxels. As shown in the animations above, there's a number of render modes available.  Shown here are filled circles, rounded-squares, squares, and \"3d\" squares.\n\n![fillCircle](http://www.muddyhorse.com/wp-content/uploads/2013/11/fillCircle-292x300.png) ![fillRoundRect](http://www.muddyhorse.com/wp-content/uploads/2013/11/fillRoundRect-292x300.png) ![fillRect](http://www.muddyhorse.com/wp-content/uploads/2013/11/fillRect-292x300.png) ![fill3dRect](http://www.muddyhorse.com/wp-content/uploads/2013/11/fill3dRect-292x300.png)\n\nAnd there's non-filled versions of the same shapes:\n\n![circle](http://www.muddyhorse.com/wp-content/uploads/2013/11/circle-292x300.png) ![roundRect](http://www.muddyhorse.com/wp-content/uploads/2013/11/roundRect-292x300.png) ![rect](http://www.muddyhorse.com/wp-content/uploads/2013/11/rect-292x300.png) ![3drect](http://www.muddyhorse.com/wp-content/uploads/2013/11/3drect-292x300.png)\n\nLimitations\n-----------\n\nAs you can see from the samples, this isn't a photorealistic engine.  It's geared more for pixel-art and retro-style visuals, but allows for some nifty things, as the combinations of projections and renderers allow for very different looks.\n\nGrids should be considered the smallest practical unit of animation.  Voxels inside a grid don't move relative to one another.  Grids can support adding and removing voxels, but a voxel should only be in a single Grid.\n\nMy expectation is that the camera will always be looking down the z-axis.  The position of the camera may change, but not the direction.\n\nWhy?\n----\nThis is a way to learn some little bits about 3d graphics while working in a simple space.  And potentially it can be a good platform from which to develop some small games.  Also helps me think about and [write about](http://www.muddyhorse.com/category/technical/wannabe/) the process from a developer's standpoint.\n\nLicense\n-------\nI chose the MIT license at this time.  Please contribute back fixes you come across!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpforhan%2Fwannabe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpforhan%2Fwannabe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpforhan%2Fwannabe/lists"}