0

gl-matrix's quaternion object has 3 functions rotateX, rotateY and rotateZ which rotates quaternion by the specific axis. Now I want to do the same using phi and theta instead of xyz.

How is this possible ? Is it possible to extract some value then pass it to rotateX, rotateY and rotateZ ?

Mohebifar
  • 3,341
  • 1
  • 24
  • 32

1 Answers1

1

I'm not sure what you want to achieve exactly but in your quat object you have a function setAxisAngle that allows you to pass any axis and amount of rotation around that axis. This way you can have a quaternion rotated around arbitrary vector.

If you need few such rotations at once, just multiply few quaternions (but remember to normalise them!).

kolenda
  • 2,741
  • 2
  • 19
  • 30