{"id":19815210,"url":"https://github.com/akbartus/a-frame-occlusion-component","last_synced_at":"2026-05-10T12:03:38.171Z","repository":{"id":192898266,"uuid":"687691056","full_name":"akbartus/A-Frame-Occlusion-Component","owner":"akbartus","description":"This is A-Frame component for occlusions. ","archived":false,"fork":false,"pushed_at":"2023-09-06T18:59:57.000Z","size":1226,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-11T07:43:48.193Z","etag":null,"topics":["a-frame","aframevr","occlusion","threejs"],"latest_commit_sha":null,"homepage":"https://occlusion-component.glitch.me/","language":"JavaScript","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/akbartus.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}},"created_at":"2023-09-05T19:58:05.000Z","updated_at":"2024-07-12T22:02:47.000Z","dependencies_parsed_at":"2023-09-05T21:23:22.223Z","dependency_job_id":"e7aec696-206f-4715-a181-933a163d0e7e","html_url":"https://github.com/akbartus/A-Frame-Occlusion-Component","commit_stats":null,"previous_names":["akbartus/a-frame-occlusion-component"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akbartus%2FA-Frame-Occlusion-Component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akbartus%2FA-Frame-Occlusion-Component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akbartus%2FA-Frame-Occlusion-Component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akbartus%2FA-Frame-Occlusion-Component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akbartus","download_url":"https://codeload.github.com/akbartus/A-Frame-Occlusion-Component/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241167996,"owners_count":19921304,"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":["a-frame","aframevr","occlusion","threejs"],"created_at":"2024-11-12T10:05:10.263Z","updated_at":"2026-05-10T12:03:33.127Z","avatar_url":"https://github.com/akbartus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A-Frame-Occlusion-Component\n\u003cimg alt=\"Screenshot\" src=\"img/screenshot.jpg\" width=\"600\"\u003e\n\n### **Description / Rationale**\nThis is the A-Frame component, which lets achieve occlusion effects. It can be useful specifically in webAR related projects.     \n\n### **Instructions**\nThe component has the following attributes:\n* occlusionModelUrl: { type: 'string' } - url to a gltf model, which will serve as occlusion model.\n* occlusionModelPosition: { type: 'vec3', default: { x: 0, y: 0, z: -3 } } - occlusion model position.\n* occlusionModelRotation: { type: 'vec3', default: { x: 0, y: 0, z: 0 } } - occlusion model rotation.\n* occlusionModelScale: { type: 'vec3', default: { x: 1, y: 1, z: 1 } } - occlusion model scale.\n* occlusionModelPart: { type: 'boolean', default: false } - indicate if specific part/s of the occlusion model will serve for occlusion (i.e. whether only part/s of the model should serve for occlusion). \n* partNames: { type: 'array'} - if occlusionModelPart is true, then include the names of the parts of occlusion model, which will serve for occlusion.\n* occludedModelUrl: { type: 'string' } - url to gltf model which will be occluded by occlusion model.\n* occludedModelPosition: { type: 'vec3', default: { x: 0, y: 0, z: -4 } } - occluded model position. \n* occludedModelRotation: { type: 'vec3', default: { x: 0, y: 0, z: 0 } } - occluded model rotation.\n* occludedModelScale: { type: 'vec3', default: { x: 1, y: 1, z: 1 } } - occluded model scale.\nTo see component at work, include \"occlusion-component\" to a-entity.\n\nBelow a detailed implementation of the component is given: \n```\n\u003chtml\u003e\n\u003chead\u003e\n    \u003ctitle\u003eA-Frame Occlusion Component\u003c/title\u003e\n    \u003cscript src='https://aframe.io/releases/1.4.2/aframe.min.js'\u003e\u003c/script\u003e\n    \u003cscript src='https://cdn.jsdelivr.net/gh/akbartus/A-Frame-Occlusion-Component/js/occlusion-component.js'\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n    \u003ca-scene\u003e\n        \u003ca-entity occlusion-component=\"occlusionModelUrl: https://cdn.glitch.global/e8ae677c-5258-4984-ad8d-347b2293a371/plane.glb;\n                                      occludedModelUrl: https://cdn.glitch.global/e8ae677c-5258-4984-ad8d-347b2293a371/xbot.glb;\n                                      occlusionModelPosition: 0 1 -3;\n                                      occlusionModelRotation: 0 0 0;\n                                      occlusionModelScale: 2 2 2;\n                                      occlusionModelPart: false;\n                                      partNames: Beta_Surface; \n                                      occludedModelPosition: 0 0 -4;\n                                      occludedModelRotation: 0 0 0;\n                                      occludedModelScale: 2 2 2;\"\u003e\u003c/a-entity\u003e\n        \u003ca-entity occlusion-component=\"occlusionModelUrl: https://cdn.glitch.global/e8ae677c-5258-4984-ad8d-347b2293a371/sphere.glb;\n                                      occludedModelUrl: https://cdn.glitch.global/e8ae677c-5258-4984-ad8d-347b2293a371/box.glb;\n                                      occlusionModelPosition: -3 1 -3;\n                                      occlusionModelRotation: 0 0 0;\n                                      occlusionModelScale: 1 1 1;\n                                      occlusionModelPart: false;\n                                      occludedModelPosition: -3 1 -3.5;\n                                      occludedModelRotation: 0 0 0;\n                                      occludedModelScale: 2 2 2;\"\u003e\u003c/a-entity\u003e\n        \u003ca-plane position=\"0 0 -4\" rotation=\"-90 0 0\" width=\"8\" height=\"4\" color=\"#7BC8A4\"\u003e\u003c/a-plane\u003e\n        \u003ca-sky color='#ECECEC'\u003e\u003c/a-sky\u003e\n    \u003c/a-scene\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\nIn addition, a sample implementation of occlusion is provided for Three.js.\n\n\u003cb\u003eNote:\u003c/b\u003e When making more complex gltf file serve as occluder (not plane or other primitives), the component sometimes might not work properly (no occlusion occurs). Changing A-Frame version to 1.2.0 solves this issue.\n\n### **Tech Stack**\nThe project is powered by AFrame and Three.js\n\n### **Demo**\nTo see the application at work: [Demo application](https://occlusion-component.glitch.me/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakbartus%2Fa-frame-occlusion-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakbartus%2Fa-frame-occlusion-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakbartus%2Fa-frame-occlusion-component/lists"}