Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/riccardoscalco/glsl-rodrigues-rotation
GLSL implementation of the Rodrigues's rotation formula.
https://github.com/riccardoscalco/glsl-rodrigues-rotation
glsl rotation webgl
Last synced: 2 days ago
JSON representation
GLSL implementation of the Rodrigues's rotation formula.
- Host: GitHub
- URL: https://github.com/riccardoscalco/glsl-rodrigues-rotation
- Owner: riccardoscalco
- License: mit
- Created: 2020-01-11T09:42:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-01-11T09:47:21.000Z (over 4 years ago)
- Last Synced: 2023-12-09T06:00:38.653Z (10 months ago)
- Topics: glsl, rotation, webgl
- Language: GLSL
- Homepage: https://github.com/riccardoscalco/glsl-rodrigues-rotation
- Size: 46.9 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# glsl-rodrigues-rotation
Glsl implementation of the Rodrigues's rotation formula. An efficient algorithm for rotating a vector in space, given an axis and angle of rotation (https://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula).
## Install
```sh
npm install glsl-rodrigues-rotation
```## Usage
```glsl
#pragma glslify: rotate = require(glsl-rodrigues-rotation)vec3 vector = vec3(1., 0., 0.);
vec3 axis = vec3(0., 1., 0.);
float angle = 3.141592653589793 / 2.;
vec3 rotatedVector = rotate(vector, axis, angle); // return vec3(0., 0., -1.)
```