Skip to content

Convert a 4x4 matrix into a dual quaternion. Useful for skeletal animation (dual quaternion linear blending)

Notifications You must be signed in to change notification settings

chinedufn/mat4-to-dual-quat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mat4-to-dual-quat npm version Build Status

Convert a 4x4 matrix into a dual quaternion. Useful for skeletal animation

Background / Initial Motivation

This module was made to help with dual quaternion linear blending.

To Install

$ npm install --save mat4-to-dual-quat

Usage

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

API

mat4ToDualQuat(matrix) -> Array[8]

matrix

Requred

Type: Array[16]

The 4x4 matrix that you would like to convert into a dual quaternion

See Also

References

License

MIT

About

Convert a 4x4 matrix into a dual quaternion. Useful for skeletal animation (dual quaternion linear blending)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published