glMatrix 3.4 from quat to modeView rotation

12 views Asked by At

I updated my app in hope to use new func. This is inrterest part of my code:

Part of draw procedure:


// coming from cannonjs
var QP =object.physics.currentBody.quaternion;

var newrot = mat4.create()
mat4.fromQuat(newrot, quat.fromValues(QP.x, QP.y, QP.z, QP.w) )

mat4.multiply(object.mvMatrix, newrot, object.mvMatrix);
    

Rotation is not correct ... Any suggestion !

0

There are 0 answers