Convert a 4x4 matrix into a dual quaternion. Useful for skeletal animation
This module was made to help with dual quaternion linear blending.
$ npm install --save mat4-to-dual-quat
var mat4ToDualQuat = require('mat4-to-dual-quat')
var dualQuat = mat4ToDualQuat([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])
console.log(dualQuat)
// [0, 0, 0, 1, 0, 0, 0, 0]
// The first 4 elements are the rotation quaternion
// The last 4 elements are they translation quaternion
Requred
Type: Array[16]
The 4x4 matrix that you would like to convert into a dual quaternion
- http://cs.gmu.edu/~jmlien/teaching/cs451/uploads/Main/dual-quaternion.pdf
- 4x4 matrix to dual quaternion formula is in Section 7.1.6
MIT