I am trying to have the camera orbit around an arbitrary axis in world space. I've already spent so many hours trying to solve this issue without luck. I do not want to add a library like THREE.OrbitControls just to have this feature. Can anyone tell me what I'm doing wrong in the following code?
Camera.prototype.orbit = function(axis, spd, pt) {
var axis = axis.normalize(),
currCamQuaternion = new THREE.Quaternion(this.position.x, this.position.y, this.position.z, 0),
rotQuaternion = new THREE.Quaternion();
rotQuaternion.setFromAxisAngle(axis, spd);
var halfCamQuaternion = rotQuaternion.clone().multiply(currCamQuaternion),
fullCamQuaternion = halfCamQuaternion.clone().multiply(rotQuaternion.clone().conjugate());
this.position.copy(new THREE.Vector3(fullCamQuaternion.x, fullCamQuaternion.y, fullCamQuaternion.z));
this.lookAt(pt);
}