{"id":15287956,"url":"https://github.com/rozek/aframe-vertical-billboard-component","last_synced_at":"2025-04-13T06:09:33.749Z","repository":{"id":56848451,"uuid":"526262362","full_name":"rozek/aframe-vertical-billboard-component","owner":"rozek","description":"a simple \"billboard\" component and primitive for A-Frame","archived":false,"fork":false,"pushed_at":"2022-08-29T10:25:01.000Z","size":347,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T22:45:29.439Z","etag":null,"topics":["a-frame","billboard","component","primitive","three-js","threejs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/rozek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-18T15:12:48.000Z","updated_at":"2024-03-13T14:08:09.000Z","dependencies_parsed_at":"2022-09-08T06:50:24.053Z","dependency_job_id":null,"html_url":"https://github.com/rozek/aframe-vertical-billboard-component","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/rozek%2Faframe-vertical-billboard-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozek%2Faframe-vertical-billboard-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozek%2Faframe-vertical-billboard-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rozek%2Faframe-vertical-billboard-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rozek","download_url":"https://codeload.github.com/rozek/aframe-vertical-billboard-component/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670435,"owners_count":21142904,"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","billboard","component","primitive","three-js","threejs"],"created_at":"2024-09-30T15:40:04.000Z","updated_at":"2025-04-13T06:09:33.729Z","avatar_url":"https://github.com/rozek.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aframe-vertical-billboard-component #\n\na simple vertical \"billboard\" component and primitive for A-Frame\n\nThree.js [Sprites](https://threejs.org/docs/#api/en/objects/Sprite) are planes which always face the camera - but sometimes, the vertical axis of such objects should keep pointing upwards, regardless of the current camera position: that's what \"billboards\" are good for.\n\n`aframe-vertical-billboard-component` implements a simple vertically oriented billboard component and primitive for [A-Frame](https://github.com/aframevr/aframe/).\n\n![Example Screenshot](screenshot.png)\n\n**NPM users**: please consider the [Github README](https://github.com/rozek/aframe-vertical-billboard-component/blob/main/README.md) for the latest description of this package (as updating the docs would otherwise always require a new NPM package version)\n\n\u003e Just a small note: if you like this work and plan to use it, consider \"starring\" this repository (you will find the \"Star\" button on the top right of this page), so that I know which of my repositories to take most care of.\n\n## Installation ##\n\n`aframe-vertical-billboard-component` may be used as an ECMAScript module (ESM) or explicitly loaded after the `\u003cscript\u003e` tag for A-Frame itself.\n\nFor the ESM variant, install the package into your build environment using [NPM](https://docs.npmjs.com/) with the command\n\n```\nnpm install aframe-vertical-billboard-component\n```\n\nand `import` it into your code whereever needed\n\n```javascript\nimport \"aframe-vertical-billboard-component\"\n```\n\nOtherwise, load the plain script file directly\n\n```html\n\u003cscript src=\"https://unpkg.com/aframe-vertical-billboard-component\"\u003e\u003c/script\u003e\n```\n\n## Properties ##\n\n`aframe-vertical-billboard-component` is an A-Frame component with the following properties:\n\n\u003ctable\u003e\n \u003ctbody\u003e\n  \u003ctr\u003e\u003cth\u003eProperties\u003c/th\u003e\u003cth\u003eDescription\u003c/th\u003e\u003c/tr\u003e\n \u003c/tbody\u003e\n \u003ctbody\u003e\n  \u003ctr\u003e\u003ctd\u003emap\u003c/td\u003e\u003ctd\u003eeither the id or the URL of an image which will be mapped onto the billboard\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003ewidth\u003c/td\u003e\u003ctd\u003ethe billboard's width or 0\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eheight\u003c/td\u003e\u003ctd\u003ethe billboard's height or 0\u003c/td\u003e\u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\nAdditionally, this module defines an A-Frame primitive named `a-billboard` for this component which maps its attributes `map`, `width` and `height` to component properties of the same name (see usage below)\n\n## Usage ##\n\nOnce loaded or imported, `aframe-vertical-billboard-component` may be used as a component of a plain A-Frame entity\n\n```html\n\u003ca-scene\u003e\n  \u003ca-assets\u003e\n    \u003cimg id=\"BillboardTexture\" src=\"...\"/\u003e\n  \u003c/a-assets\u003e\n  \u003ca-entity billboard=\"map:#BillboardTexture; height:2\" position=\"0 0 0\"\u003e\u003c/a-entity\u003e\n\u003c/a-scene\u003e\n```\n\nWithout a valid `map`, the billboard will remain invisible. If one of `width` or `height` is 0, its value will be computed from the other setting (which should therefore be \u003e 0) and the natural aspect ratio of the map (if both values are 0, the `height` will be set to 1)\n\nSince billboards are naturally vertical objects, their `position` will not specify their center, but the middle of their lower edge - this helps positioning them programmatically.\n\n### Primitive ###\n\nAlternatively, the primitive `a-billboard` may be used in order to get a more compact code:\n\n```html\n\u003ca-scene\u003e\n  \u003ca-assets\u003e\n    \u003cimg id=\"BillboardTexture\" src=\"...\"/\u003e\n  \u003c/a-assets\u003e\n  \u003ca-billboard map=\"#BillboardTexture\" height=\"2\" position=\"0 0 0\"\u003e\u003c/a-billboard\u003e\n\u003c/a-scene\u003e\n```\n\n## Example ##\n\nHere is a complete example (albeit without the HTML boilerplate)\n\n```html\n\u003cscript src=\"https://unpkg.com/aframe\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.com/aframe-hemisphere-controls\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.com/aframe-vertical-billboard-component\"\u003e\u003c/script\u003e\n\n\u003ca-scene embedded\n  hemisphere-controls=\"position:0 0.5 4; target:0 1 0\"\n  style=\"width:600px; height:450px\"\n\u003e\n  \u003ca-assets\u003e\n    \u003cimg id=\"Tree\" src=\"https://raw.githubusercontent.com/rozek/aframe-vertical-billboard-component/main/free-standing-Tree.png\"/\u003e\n  \u003c/a-assets\u003e\n\n  \u003ca-sky color=\"#555555\"\u003e\u003c/a-sky\u003e\n\n  \u003ca-plane width=\"1000\" height=\"1000\" color=\"#555555\"\n    position=\"0 0 0\" rotation=\"-90 0 0\"\n  \u003e\u003c/a-plane\u003e\n\n  \u003ca-billboard map=\"#Tree\" height=\"2\" position=\"-2 0 0.5\"\u003e\u003c/a-billboard\u003e\n  \u003ca-billboard map=\"#Tree\" height=\"2\" position=\" 0 0 0\"\u003e\u003c/a-billboard\u003e\n  \u003ca-billboard map=\"#Tree\" height=\"2\" position=\" 2 0 -0.5\"\u003e\u003c/a-billboard\u003e\n\u003c/a-scene\u003e\n```\n\nThe tree texture was made by Krzysztof Czerwiński, taken from [the freebies section of his blog](http://trzyde.blogspot.com/p/freebies_5.html) and scaled down in order to save resources - it is [free even for commercial use](https://trzyde.blogspot.com/p/license.html).\n\n## Build Instructions ##\n\nYou may easily build this package yourself.\n\nJust install [NPM](https://docs.npmjs.com/) according to the instructions for your platform and follow these steps:\n\n1. either clone this repository using [git](https://git-scm.com/) or [download a ZIP archive](https://github.com/rozek/aframe-vertical-billboard-component/archive/refs/heads/main.zip) with its contents to your disk and unpack it there \n2. open a shell and navigate to the root directory of this repository\n3. run `npm install` in order to install the complete build environment\n4. execute `npm run build` to create a new build\n\nYou may also look into the author's [build-configuration-study](https://github.com/rozek/build-configuration-study) for a general description of his build environment.\n\n## License ##\n\n[MIT License](LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frozek%2Faframe-vertical-billboard-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frozek%2Faframe-vertical-billboard-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frozek%2Faframe-vertical-billboard-component/lists"}