{"id":13831540,"url":"https://github.com/ianmackenzie/elm-3d-scene","last_synced_at":"2025-04-09T12:09:17.609Z","repository":{"id":48433937,"uuid":"86112374","full_name":"ianmackenzie/elm-3d-scene","owner":"ianmackenzie","description":"A high-level 3D rendering engine for Elm, with support for lighting, shadows, and realistic materials.","archived":false,"fork":false,"pushed_at":"2024-04-01T21:27:57.000Z","size":14579,"stargazers_count":205,"open_issues_count":58,"forks_count":27,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-01T17:05:27.411Z","etag":null,"topics":["3d","elm","hacktoberfest","rendering","webgl"],"latest_commit_sha":null,"homepage":"https://package.elm-lang.org/packages/ianmackenzie/elm-3d-scene/latest/","language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ianmackenzie.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":"2017-03-24T21:33:20.000Z","updated_at":"2024-10-08T17:15:59.000Z","dependencies_parsed_at":"2024-05-29T19:37:58.759Z","dependency_job_id":"71a76ffa-58ff-4c5b-90a7-632e812f1edc","html_url":"https://github.com/ianmackenzie/elm-3d-scene","commit_stats":{"total_commits":705,"total_committers":5,"mean_commits":141.0,"dds":"0.18297872340425536","last_synced_commit":"5f3175c7c5a8b310e3cc2ac08fbe2134e0a9ee2a"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-3d-scene","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-3d-scene/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-3d-scene/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianmackenzie%2Felm-3d-scene/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianmackenzie","download_url":"https://codeload.github.com/ianmackenzie/elm-3d-scene/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248036067,"owners_count":21037092,"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","elm","hacktoberfest","rendering","webgl"],"created_at":"2024-08-04T10:01:30.731Z","updated_at":"2025-04-09T12:09:17.587Z","avatar_url":"https://github.com/ianmackenzie.png","language":"Elm","funding_links":[],"categories":["Elm"],"sub_categories":[],"readme":"# elm-3d-scene\n\n`elm-3d-scene` is a high-level Elm package for producing 3D graphics, with\nsupport for lighting, shadows and realistic materials:\n\n![Lit scene with shadows](https://ianmackenzie.github.io/elm-3d-scene/images/1.0.0/hable-filmic-tone-mapping-bright.png)\n\nIt aims to make creating 3D graphics as easy and enjoyable as possible, without\nhaving to worry about low-level details like shader programs and transformation\nmatrices. `elm-3d-scene` uses [`elm-explorations/webgl`](https://package.elm-lang.org/packages/elm-explorations/webgl/latest/)\nunder the hood (and therefore requires [WebGL support](https://caniuse.com/#feat=webgl)\nto work), but no knowledge of WebGL is required to use this package.\n\nAny questions/feedback, please open an issue or please reach out in the\n**#webgl** channel or to **@ianmackenzie** on the [Elm Slack](https://elmlang.herokuapp.com)!\n\n## Who is this for?\n\n`elm-3d-scene` is built to support a wide range of use cases, from [simple 3D\nloading spinners](https://ianmackenzie.github.io/elm-3d-scene/examples/1.0.0/animation.html)\nup to [near-photorealistic scenes](https://ianmackenzie.github.io/elm-3d-scene/examples/1.0.0/duckling.html).\nIt is designed to be beginner-friendly with a smooth onramp to advanced features\nlike [shadows](https://ianmackenzie.github.io/elm-3d-scene/examples/1.0.0/multiple-shadows.html),\n[HDR lighting](https://ianmackenzie.github.io/elm-3d-scene/examples/1.0.0/exposure-and-tone-mapping.html)\nand [physically based materials](https://ianmackenzie.github.io/elm-3d-scene/examples/1.0.0/textured-sphere.html).\nYou can use `elm-3d-scene` to make:\n\n- Games\n- Animations\n- Visualizations\n- Scientific/engineering/technical apps and more!\n\nHowever, if you're a WebGL guru who's comfortable with writing their own shader\nprograms, then `elm-3d-scene` might not (yet?) be for you - you're currently\nlimited to the material and lighting types that `elm-3d-scene` supports\ndirectly. Eventually `elm-3d-scene` will likely support custom shaders in some\nway (see the [roadmap](#roadmap)), but it's not there yet.\n\n## Getting started\n\nThe best way to start learning the `elm-3d-scene` API is by reading through the\n[tutorial](https://github.com/ianmackenzie/elm-3d-scene/blob/master/TUTORIAL.md)\nand then checking out the [examples](https://github.com/ianmackenzie/elm-3d-scene/tree/master/examples/README.md).\nFor more details on any type/function, the [reference documentation](https://package.elm-lang.org/packages/ianmackenzie/elm-3d-scene/latest/)\nis your friend.\n\n![Duckling model](https://ianmackenzie.github.io/elm-3d-scene/images/1.0.0/textured-nonmetal-rough.png)\n\nOne important point to understand is that `elm-3d-scene` builds heavily on\nseveral other packages, making extensive use of types and modules from:\n\n  - [`avh4/elm-color`](https://package.elm-lang.org/packages/avh4/elm-color/latest/):\n    `Color`\n  - [`ianmackenzie/elm-3d-camera`](https://package.elm-lang.org/packages/ianmackenzie/elm-3d-camera/latest/):\n    `Camera3d` and `Viewpoint3d`\n  - [`ianmackenzie/elm-units`](https://package.elm-lang.org/packages/ianmackenzie/elm-units/latest/):\n    `Quantity`, `Length`, `Meters`, `Angle`, `Pixels`, `Luminance`, `Illuminance`,\n    `LuminousFlux` and `Temperature`\n  - [`ianmackenzie/elm-triangular-mesh`](https://package.elm-lang.org/packages/ianmackenzie/elm-triangular-mesh/latest/):\n    `TriangularMesh`\n  - [`ianmackenzie/elm-geometry`](https://package.elm-lang.org/packages/ianmackenzie/elm-geometry/latest/):\n    `Point3d`, `Vector3d`, `Direction3d`, `LineSegment3d`, `Triangle3d`,\n    `Sphere3d`, `Block3d`, `Axis3d`...basically anything ending in `3d` other\n    than `Camera3d` and `Viewpoint3d` =)\n\nAs a result, to start using `elm-3d-scene` in your own project you will need at\nleast a decent understanding of those packages as well. Check out their READMEs\nand reference documentation for details, but you can probably get a decent sense\nof how they work by checking out the [`elm-3d-scene` examples](https://github.com/ianmackenzie/elm-3d-scene/tree/master/examples/README.md).\n\nWhen installing `elm-3d-scene`, you'll also want to install the above packages:\n\n```text\nelm install ianmackenzie/elm-3d-scene\nelm install avh4/elm-color\nelm install ianmackenzie/elm-3d-camera\nelm install ianmackenzie/elm-units\nelm install ianmackenzie/elm-triangular-mesh\nelm install ianmackenzie/elm-geometry\n```\n\n(All of the packages will get downloaded and installed automatically anyways,\nsince they're dependencies of `elm-3d-scene`, but you'll need to install them\nexplicitly in your own project so that you can use them directly.)\n\n![Table and chairs](https://ianmackenzie.github.io/elm-3d-scene/images/1.0.0/cloudy-scene.png)\n\n## Climate action\n\nI would like for the projects I work on to be as helpful as possible in\naddressing the climate crisis. If\n\n- you are working on a project that helps address the climate crisis (clean\n  energy, public transit, reforestation, sustainable agriculture etc.) either as\n  an individual, as part of an non-profit organization or even as part of a\n  for-profit company, and\n- there is a new feature you would find helpful for that work (or a bug you need\n  fixed) in any of my open-source projects, then\n\nplease [open a new issue](https://github.com/ianmackenzie/elm-3d-scene/issues),\ndescribe briefly what you're working on and I will treat that issue as high\npriority.\n\n![Spheres and blocks](https://ianmackenzie.github.io/elm-3d-scene/images/1.0.0/point-light.png)\n\n## Roadmap\n\n`elm-3d-scene` has a decent number of features already, but there are many, many\nmore to add. Check out the [issues](https://github.com/ianmackenzie/elm-3d-scene/issues)\nto get a sense of what features are planned (and add your own feature request if\nthere's something you'd like to see!), but some of the immediate next steps will\nlikely include:\n\n- Performance improvements (there are already some [improvements in the pipeline\n  for `elm-explorations/webgl`](https://github.com/elm-explorations/webgl/pull/28)\n  that will significantly improve `elm-3d-scene` performance)\n- [Support for loading different model formats](https://github.com/ianmackenzie/elm-3d-scene/issues/30)\n  such as glTF and OBJ (likely in separate packages designed to work nicely with\n  `elm-3d-scene`, instead of being part of `elm-3d-scene` itself)\n- Support for normal and ambient occlusion mapping (already mostly implemented\n  internally)\n- [Improved line rendering](https://github.com/ianmackenzie/elm-3d-scene/issues/32)\n- [Silhouette edges/outlined meshes](https://github.com/ianmackenzie/elm-3d-scene/issues/26)\n- Some level of support for [transparent objects](https://github.com/ianmackenzie/elm-3d-scene/issues/4)\n  like windows\n\nIn the longer term, I hope to add support for:\n\n- Custom vertex and/or fragment shaders (for things like custom procedural\n  texturing, fancy material types or deformable meshes)\n- Skeletal animation (rigging/skinning)\n\nHowever, these will require some significant API design and implementation work.\n\n## Contributing\n\nContributions are very welcome! Here are some ideas for some that would be very\nuseful at this stage:\n\n- More examples to add to the `examples` directory, showing how to create\n  specific kinds of scenes or how to integrate `elm-3d-scene` with other\n  packages, such as:\n  - An example combining `elm-3d-scene` and [`elm-gamepad`](https://package.elm-lang.org/packages/xarvh/elm-gamepad/latest/),\n    perhaps using the gamepad to walk around a scene\n  - An example with shadows cast from a moving light source (I think something\n    like a point light flying in and amongst a bunch of cubes could look pretty\n    cool)\n  - Anything you think would look cool/illustrate part of the API missed by\n    other examples/help others understand something you struggled with\n- Separate packages that parse different 3D model formats so they can be loaded\n  into `elm-3d-scene`, such as [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file),\n  [STL](https://en.wikipedia.org/wiki/STL_%28file_format%29) or [DAE](https://en.wikipedia.org/wiki/COLLADA).\n\n  I think it makes sense for each file format to have a dedicated package \n  separate from `elm-3d-scene`. Ideally, I think each package should focus on\n  simply parsing a file into a nice Elm data structure (instead of directly into\n  an `elm-3d-scene` `Entity`, for example) so that the data could also be used\n  in other ways (custom rendering engines, 3D printing, analysis etc.).\n  \n  Note that some work has already started on [GLTF](https://en.wikipedia.org/wiki/GlTF)\n  loading, so reach out to me (**@ianmackenzie**) on the [Elm Slack](http://elmlang.herokuapp.com/)\n  if that's something you're interested in working on.\n\nOnce the internals of `elm-3d-scene` stabilize a bit, there will be lots more\nopportunities to contribute to the core rendering engine, to add features such\nas:\n\n- Textured backgrounds ([#53](https://github.com/ianmackenzie/elm-3d-scene/issues/53))\n- Rectangular/polygonal light sources ([#41](https://github.com/ianmackenzie/elm-3d-scene/issues/41))\n- 3D-rendered text ([#37](https://github.com/ianmackenzie/elm-3d-scene/issues/37))\n- Procedural textures ([#22](https://github.com/ianmackenzie/elm-3d-scene/issues/22))\n- Debug rendering options ([#21](https://github.com/ianmackenzie/elm-3d-scene/issues/21))\n- Funky material types like water and ceramics ([#5](https://github.com/ianmackenzie/elm-3d-scene/issues/5))\n\nFor now, though, the internals are changing rapidly enough that\ncoordination/collaboration on these kinds of issues would be tricky.\n\n![Physics simulation](https://ianmackenzie.github.io/elm-3d-scene/images/1.0.0/physics-background-600px.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianmackenzie%2Felm-3d-scene","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianmackenzie%2Felm-3d-scene","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianmackenzie%2Felm-3d-scene/lists"}