I am working on an L-system interpreter, and I use quaternion as an internal representation of rotation. I need to export the result to a JavaScript scene in Javascript, and I found the json scene to be the best way to do this.
I found one example scene at https://github.com/mrdoob/three.js/blob/master/examples/scenes/test_scene.js , but there is nothing about quaternion rotations.
So, I used the help of http://threejs.org/io/s/quaternion and found that THREE.Object3D has quaternion and useQuaternion properties , but it does not seem to work, the error occurs when loading the scene (possibly due to lack of the rotation attribute, see EDIT at the end):
"obj": { ... "quaternion": [0.38268343236509,0,0,0.923879532511287], "useQuaternion": true }
I also tried to convert the quaternion into Euler angles, but it will not work for me, possibly due to a different order of application of the angles (I assume that the order is Y, Z, X). In the above example, the quaternion represents a 135 degree rotation around the Z axis (step), which will convert to Euler angles [pi, pi, pi / 4], but it does not display correctly in the scene.
The following figure shows the blocks, each of which is rotated 11 degrees more than the other along the Z axis. Axes X (red), Y (green) and Z (blue). The upper half rotates incorrectly due to incorrect quaternion conversion to Euclid (I used this page to implement: http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/ ).

EDIT: after further study, the error caused by the scene loader is due to the absence of the rotation attribute on the object. After exiting, do not throw an error, and the scene is loaded, but it is incorrect (as shown in the figure), since the rotation of the quaternions is ignored.
"obj": { ... "rotation": [3.14159265358979,3.14159265358979,0.785398163397449], "quaternion": [0.38268343236509,0,0,0.923879532511287], "useQuaternion": true }