How to calculate the new vector of a 3D vector rotated by the quaternion of threeJS?

given a quaternion, how to calculate the new vector of a three-dimensional vector rotated by this quaternion?

Quaternion refers to Quaternion of the threeJS document

I understand the formula for calculating rotation of quaternions. I can write it myself, but I always think that the quaternion of threejs must have an api that can be calculated. I don"t have to write it myself, but I can"t find it in the interface document. Which one is it?

< hr >

rotation formula reference: https://www.zhihu.com/questio.

if you want to calculate a dot clipboard.png w ,:

1.

clipboard.png

2.

clipboard.png

3. qw 0:

clipboard.png

4.qw clipboard.png w :

clipboard.png

in this way, a quaternion rotation operation is completed.

Mar.18,2021

you mean the rotation matrix (Matrix4) of the object's coordinates. Object3D.setRotationFromMatrix
reference https://threejs.org/docs/inde.
or Euler angle rotation (Euler) object3D.setRotationFromEuler
reference https://threejs.org/docs/inde.
or axis angle rotation (Vector3, Float) object3D.setRotationFromAxisAngle
reference https://threejs.org/docs/inde.

Menu