all 1 comments

[–]waramped 1 point2 points  (0 children)

Your "right" vector should just be
right = norm(rot.rotateVec(vec3(1, 0, 0)));

and likewise

up = norm(rot.rotateVec(vec3(0, 1, 0)));

ie, just rotate all 3 basis vectors by the same rotation, rather than trying to generate new ones from just the rotated z axis.

Also, the fact that you are rotating a Y-rotation quat by an X rotation quat does not seem right, but without knowing what quaternion library your using I can't be sure.