-
Replies
I think you want to negate the axis. Finding the inverse of the rotation matrix is the matrix that when multiplying the original matrix returns a 1.
Why are you negating the (x,y,z) components of the quaternion?
scanbooster is not only negating the axis, he/she is also permutating y and z
If I remember correctly, the inverse of (x, y, z, w) quaternion is (with S being square of norm, S = x2 + y2 + z2 + w2):
(-x/S, -y/S, -z/S, w/S)
So maybe there is an error here:
self.init(ix: -Float(cmqUpright.x), iy: -Float(cmqUpright.z), iz: -Float(cmqUpright.y), r: Float(cmqUpright.w))
Shouldn't it be
self.init(ix: -Float(cmqUpright.x), iy: -Float(cmqUpright.y), iz: -Float(cmqUpright.z), r: Float(cmqUpright.w))
of course assuming cmqUpright as a norm value of 1.
You edited the content, making the message impossible to understand.
Please delete it or restore the initial message.
BTW, was the answer OK ?