{"id":20767736,"url":"https://github.com/dmnsgn/glsl-rotate","last_synced_at":"2025-04-09T10:09:20.152Z","repository":{"id":50592013,"uuid":"120763657","full_name":"dmnsgn/glsl-rotate","owner":"dmnsgn","description":"GLSL rotation functions with matrices: 2D and 3D (with X/Y/Z convenience functions) available both as ES modules strings and as GLSL files for use with glslify.","archived":false,"fork":false,"pushed_at":"2024-07-06T14:49:03.000Z","size":57,"stargazers_count":135,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-02T08:13:14.237Z","etag":null,"topics":["2d","3d","glsl","glslify","matrix","rotate","webgl"],"latest_commit_sha":null,"homepage":"https://dmnsgn.github.io/glsl-rotate/","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/dmnsgn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.MD","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":"2018-02-08T13:17:27.000Z","updated_at":"2025-03-24T13:53:17.000Z","dependencies_parsed_at":"2024-06-19T00:23:45.465Z","dependency_job_id":"3e912938-1816-41da-83f0-da29640229bf","html_url":"https://github.com/dmnsgn/glsl-rotate","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"363ed12af808748c1364f30dd8dc1054fdf59a81"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fglsl-rotate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fglsl-rotate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fglsl-rotate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmnsgn%2Fglsl-rotate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmnsgn","download_url":"https://codeload.github.com/dmnsgn/glsl-rotate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018061,"owners_count":21034048,"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":["2d","3d","glsl","glslify","matrix","rotate","webgl"],"created_at":"2024-11-17T11:33:11.675Z","updated_at":"2025-04-09T10:09:20.124Z","avatar_url":"https://github.com/dmnsgn.png","language":"JavaScript","funding_links":["https://paypal.me/dmnsgn"],"categories":[],"sub_categories":[],"readme":"# glsl-rotate\n\n[![npm version](https://img.shields.io/npm/v/glsl-rotate)](https://www.npmjs.com/package/glsl-rotate)\n[![stability-frozen](https://img.shields.io/badge/stability-frozen-brightgreen.svg)](https://www.npmjs.com/package/glsl-rotate)\n[![npm minzipped size](https://img.shields.io/bundlephobia/minzip/glsl-rotate)](https://bundlephobia.com/package/glsl-rotate)\n[![dependencies](https://img.shields.io/librariesio/release/npm/glsl-rotate)](https://github.com/dmnsgn/glsl-rotate/blob/main/package.json)\n[![types](https://img.shields.io/npm/types/glsl-rotate)](https://github.com/microsoft/TypeScript)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-fa6673.svg)](https://conventionalcommits.org)\n[![styled with prettier](https://img.shields.io/badge/styled_with-Prettier-f8bc45.svg?logo=prettier)](https://github.com/prettier/prettier)\n[![linted with eslint](https://img.shields.io/badge/linted_with-ES_Lint-4B32C3.svg?logo=eslint)](https://github.com/eslint/eslint)\n[![license](https://img.shields.io/github/license/dmnsgn/glsl-rotate)](https://github.com/dmnsgn/glsl-rotate/blob/main/LICENSE.md)\n\nGLSL rotation functions with matrices: 2D and 3D (with X/Y/Z convenience functions) available both as ES modules strings and as GLSL files for use with glslify.\n\n[![paypal](https://img.shields.io/badge/donate-paypal-informational?logo=paypal)](https://paypal.me/dmnsgn)\n[![coinbase](https://img.shields.io/badge/donate-coinbase-informational?logo=coinbase)](https://commerce.coinbase.com/checkout/56cbdf28-e323-48d8-9c98-7019e72c97f3)\n[![twitter](https://img.shields.io/twitter/follow/dmnsgn?style=social)](https://twitter.com/dmnsgn)\n\n## Installation\n\n```bash\nnpm install glsl-rotate\n```\n\n## Usage\n\n### ESM\n\n```js\nimport * as glslRotate from \"glsl-rotate\";\nimport * as glslConstants from \"glsl-constants\";\n\nconst shader = /* glsl */ `\n${glslRotate.ROTATE}\n${glslRotate.ROTATE_X}\n${glslRotate.ROTATE_Y}\n${glslRotate.ROTATE_Z}\n\n${glslConstants.HALF_PI}\n\nvoid main() {\n  // ...\n  vec2 p2d = vec2(1.0, 0.0);\n  vec3 p3d = vec3(1.0, 0.0, 0.0);\n\n  // 2d rotation\n  p2d = rotate(p2d, HALF_PI);\n\n  // 3d rotation\n  // arbitrary axis\n  vec3 axis = vec3(1.0, 0.0, 0.0);\n  vec3 p3dA = rotate(p3d, axis, HALF_PI);\n\n  // X/Y/Z axis\n  vec3 p3dX = rotateX(p3d, HALF_PI);\n  vec3 p3dY = rotateY(p3d, HALF_PI);\n  vec3 p3dZ = rotateZ(p3d, HALF_PI);\n}`;\n```\n\n### glslify\n\n```glsl\n#pragma glslify: rotate = require(glsl-rotate/rotate)\n#pragma glslify: rotateX = require(glsl-rotate/rotateX)\n#pragma glslify: rotateY = require(glsl-rotate/rotateY)\n#pragma glslify: rotateZ = require(glsl-rotate/rotateZ)\n\n#pragma glslify: HALF_PI = require(glsl-constants/HALF_PI)\n\nvoid main() {\n  vec2 p2d = vec2(1.0, 0.0);\n  vec3 p3d = vec3(1.0, 0.0, 0.0);\n\n  // 2d rotation\n  p2d = rotate(p2d, HALF_PI);\n\n  // 3d rotation\n  // arbitrary axis\n  vec3 axis = vec3(1.0, 0.0, 0.0);\n  vec3 p3dA = rotate(p3d, axis, HALF_PI);\n\n  // X/Y/Z axis\n  vec3 p3dX = rotateX(p3d, HALF_PI);\n  vec3 p3dY = rotateY(p3d, HALF_PI);\n  vec3 p3dZ = rotateZ(p3d, HALF_PI);\n}\n```\n\n## License\n\nMIT. See [license file](https://github.com/dmnsgn/glsl-rotate/blob/main/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmnsgn%2Fglsl-rotate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmnsgn%2Fglsl-rotate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmnsgn%2Fglsl-rotate/lists"}