{"id":15633621,"url":"https://github.com/spite/three.decalgeometry","last_synced_at":"2025-03-17T13:11:30.088Z","repository":{"id":18177509,"uuid":"21291014","full_name":"spite/THREE.DecalGeometry","owner":"spite","description":"Decals for three.js","archived":false,"fork":false,"pushed_at":"2017-01-05T18:16:44.000Z","size":2787,"stargazers_count":157,"open_issues_count":3,"forks_count":25,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-05T03:14:52.580Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spite.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-27T22:24:58.000Z","updated_at":"2025-01-07T05:04:48.000Z","dependencies_parsed_at":"2022-09-24T22:33:56.001Z","dependency_job_id":null,"html_url":"https://github.com/spite/THREE.DecalGeometry","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/spite%2FTHREE.DecalGeometry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spite%2FTHREE.DecalGeometry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spite%2FTHREE.DecalGeometry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spite%2FTHREE.DecalGeometry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spite","download_url":"https://codeload.github.com/spite/THREE.DecalGeometry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244039208,"owners_count":20387834,"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":[],"created_at":"2024-10-03T10:49:41.953Z","updated_at":"2025-03-17T13:11:30.069Z","avatar_url":"https://github.com/spite.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"THREE.DecalGeometry.js\n=========================\n\nThis object creates a decal geometry, intersecting a cube against a THREE.Geometry. Based on this article [How to project decals](http://blog.wolfire.com/2009/06/how-to-project-decals/). It interesects a cube against an arbitrary geometry and clips vertex coordinates and normals.\n\n![Image](https://raw.githubusercontent.com/spite/THREE.DecalGeometry/master/demo/assets/snapshot.jpg)\n\nDemo is here: [Decal Splatter](http://clicktorelease.com/code/decal-splatter).\n\nHow to use\n----------\n\nInclude the library:\n\u003cpre\u003e\u003ccode\u003e\u0026lt;script src=\"THREE.DecalGeometry.js\" \u0026gt;\u0026lt;/script\u0026gt;\u003c/code\u003e\u003c/pre\u003e\n\nInstantiate a geometry passing:\n\u003cpre\u003e\u003ccode\u003evar decalGeometry = new THREE.DecalGeometry(  \n    meshToIntersect, // it has to be a THREE.Mesh\n    position, // THREE.Vector3 in world coordinates  \n    direction, // THREE.Vector3 specifying the orientation of the decal  \n    dimensions, // THREE.Vector3 specifying the size of the decal box  \n    check // THREE.Vector3 specifying what sides to clip (1-clip, 0-noclip)  \n);\u003c/code\u003e\u003c/pre\u003e\n\nand create a mesh using that geometry, as usual:\n\n\u003cpre\u003e\u003ccode\u003evar mesh = new THREE.Mesh( decalGeometry, decalMaterial );\u003c/pre\u003e\u003c/code\u003e\n\nThe decal material can be any material, just make sure to have this attributes enabled:\n\n\u003cpre\u003e\u003ccode\u003evar decalMaterial = new THREE.MeshNormalMaterial( {  \n    transparent: true, \n\tdepthTest: true,   \n\tdepthWrite: false,   \n\tpolygonOffset: true,  \n\tpolygonOffsetFactor: -4,   \n});\u003c/pre\u003e\u003c/code\u003e\n\nLicense\n-------\n\nMIT licensed\n\nCopyright (C) 2014 Jaume Sanchez Elias http://twitter.com/thespite\nLee Perry Smith's head model and textures by [Infinite Realities](http://www.ir-ltd.net/)\n\nhttp://www.clicktorelease.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspite%2Fthree.decalgeometry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspite%2Fthree.decalgeometry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspite%2Fthree.decalgeometry/lists"}