I'm trying to convert Go Pro gyro data to Three.js coordinates so that I can project the footage onto the inside of a sphere, rotate the sphere and have 3D stabilisation.
The camera is orientated as such, and the order of the coordinates is Z,X,Y
I'm attempting to apply this vector to rotate the sphere, something like this
this._nextVec3.set(this._next[0],this._next[1],this._next[2])
this.el.object3D.rotation.setFromVector3(this._nextVec3)
But I can't get the rotation to match the rotation of the camera, and I assume it's something to do with the left/right hand configuration?
Can anyone help?
First of all, make sure you specify the correct
rotation.order
attribute. Since you said it'sZXY
, then it should be a simpleSecondly, check out the Three.js axes, taken from the editor:
As you can see, the WebGL axes are different than the GoPro. I think you'll have to flip the X-axis, and swap the Z and Y. So maybe something like: