{"id":18087614,"url":"https://github.com/aheze/prism","last_synced_at":"2025-04-04T07:06:56.606Z","repository":{"id":60251409,"uuid":"541748761","full_name":"aheze/Prism","owner":"aheze","description":"A lightweight 3D renderer for SwiftUI.","archived":false,"fork":false,"pushed_at":"2023-06-03T02:25:46.000Z","size":30443,"stargazers_count":946,"open_issues_count":4,"forks_count":35,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-03-28T06:07:03.887Z","etag":null,"topics":["3d","3d-graphics","ios","scenekit","swift","swiftui"],"latest_commit_sha":null,"homepage":"https://twitter.com/aheze0/status/1574616440941948928","language":"Swift","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/aheze.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":"2022-09-26T19:23:02.000Z","updated_at":"2025-03-22T08:03:09.000Z","dependencies_parsed_at":"2024-12-25T13:08:10.837Z","dependency_job_id":"c9a30782-afaf-4435-ad41-19466fb59790","html_url":"https://github.com/aheze/Prism","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheze%2FPrism","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheze%2FPrism/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheze%2FPrism/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aheze%2FPrism/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aheze","download_url":"https://codeload.github.com/aheze/Prism/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247135144,"owners_count":20889421,"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","3d-graphics","ios","scenekit","swift","swiftui"],"created_at":"2024-10-31T17:04:38.504Z","updated_at":"2025-04-04T07:06:56.584Z","avatar_url":"https://github.com/aheze.png","language":"Swift","readme":"\u003cimg width=\"200\" alt=\"Island\" src=\"Assets/Island.gif\"\u003e\n\n# Prism\n\nA lightweight 3D renderer for SwiftUI.\n\n- Works with any SwiftUI `View`.\n- Fully interactive and animatable.\n- Compatible with all SwiftUI modifiers.\n- No positioning side effects, unlike GeometryReader.\n- 100% SwiftUI — no SceneKit, SpriteKit, etc.\n- Powered by perspective transforms, so it's fast.\n- Supports sizing, extrusion, levitation, and more.\n- Compose complex scenes with a familiar API.\n\n![Logo cube](Assets/Logo.png) | ![Square that animates into a cube, with border](Assets/Transform.gif) | ![3 green cubes that bounce on click](Assets/Bounce.gif) | ![Thin, levitating blue prism](Assets/Gradient.png) | ![Prism with an image on each side](Assets/Image.png)\n--- | --- | --- | --- | ---\n\n## Installation\n\nRequires iOS 13+ or macOS Catalina and up. Prism can be installed through the [Swift Package Manager](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app).\n\n```\nhttps://github.com/aheze/Prism\n```\n\n## Usage\n\nPrism is designed to be easy to use. First, define a `PrismConfiguration` for customization. Then add a `PrismCanvas`, which can contain as many `PrismView`s as you'd like.\n\n```swift\nstruct ContentView: View {\n    @State var configuration = PrismConfiguration(\n        tilt: 0.5, /// A value from 0 to 1, representing the perspective.\n        size: CGSize(width: 200, height: 200), /// How big the prism is.\n        extrusion: 100, /// The z height.\n        levitation: 20, /// How far the prism is from the ground.\n        shadowColor: Color.black, /// A dynamic shadow that's rendered underneath the prism.\n        shadowOpacity: 0.25 /// The strength of the shadow.\n    )\n\n    var body: some View {\n        PrismCanvas(tilt: configuration.tilt) {\n            PrismView(configuration: configuration) {\n                Color.blue\n            } left: {\n                Color.red\n            } right: {\n                Color.green\n            }\n        }\n    }\n}\n```\n\n\u003cimg src=\"Assets/Result.png\" width=\"300\" alt=\"Result, a multicolored cube\"\u003e\n\n## Example\n\nThe example app includes a bunch of samples to play with. [Download](https://github.com/aheze/Prism/archive/refs/heads/main.zip) it here!\n\n\u003cimg src=\"Assets/Example.png\" width=\"300\" alt=\"Screenshot of example app\"\u003e\n\n## Customization\n\nPrism supports extensive customization through the [`PrismConfiguration`](https://github.com/aheze/Prism/blob/main/Sources/PrismConfiguration.swift) struct. Check out the example app for an editor!\n\nhttps://user-images.githubusercontent.com/49819455/192427694-1b91805a-4fc0-4a3a-985f-ac57c0dd8f95.mp4\n\n## Community\n\nAuthor | Contributing | Need Help?\n--- | --- | ---\nPrism is made by [aheze](https://github.com/aheze). | All contributions are welcome. Just [fork](https://github.com/aheze/Prism/fork) the repo, then make a pull request. | Open an [issue](https://github.com/aheze/Prism/issues) or join the [Discord server](https://discord.com/invite/Pmq8fYcus2). You can also ping me on [Twitter](https://twitter.com/aheze0). Or read the source code — there's lots of comments.\n\n\n### Apps Using Prism\n\n[**SwiftUICraft**](https://github.com/aheze/SwiftUICraft) is Minecraft but made with Prism. You can move, add blocks, add water, switch worlds, and more. Thanks to Prism it's 100% SwiftUI with literally nothing else!\n\nhttps://user-images.githubusercontent.com/49819455/200998762-50a279ca-6460-4aa9-bb85-0d1b96c580ed.mp4\n\n[**Find**](http://getfind.app) is an app for browsing photos. Prism is used in the onboarding screen — download to check it out!\n\nhttps://user-images.githubusercontent.com/49819455/192427675-c66ca9fa-48f7-4730-92b3-d0d58fdf72c4.mp4\n\n\nIf you have an app that uses Prism, just make a PR or [message me](https://twitter.com/aheze0).\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2023 A. Zheng\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faheze%2Fprism","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faheze%2Fprism","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faheze%2Fprism/lists"}