I’m trying tio create a function to rotate a vector by a given quaternion, I have come up with the following:
def RotateVectorQu(refveca, refqu):
veca = Mathutils.Vector(refveca)
qu = Mathutils.Quaternion(refqu)
rotmat = qu.toMatrix()
vecb = rotmat * veca
return vecb
But it seems to be only rotating around one axis, do I need to rotate each axis seperately? and if so what order? Is there a neater way of doing this maybe with a built in method/function?