glsl-rodrigues-rotation

1.0.1 • Public • Published

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

npm install glsl-rodrigues-rotation

Usage

#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.) 

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    2

Package Sidebar

Install

npm i glsl-rodrigues-rotation

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

4.52 kB

Total Files

6

Last publish

Collaborators

  • riccardoscalco