My coding system consists of 2 unit vectors labeled 'Ox' and 'Oy', 1 insertion point, and nearby is an 'Oz' vector that always appears to be {0 0 1}.
For instance (after 2 rotations):
Ox:{x: 0.956304755963036, y: -0.292371704722735, z: 0}
Oy:{x: -0.250611464938861, y: -0.819713166317425, z: 0.51503807491006}
move:{x: 889.08282028218, y: -845.071708420642, z: -396.787982804802}
The question at hand is: how do I align my_mesh with this system using three.js?
Although I'm unsure of how it projects, thanks to this answer, I have the following solution:
if( 'Ox' in align && 'Oy' in align ){
var mx = new THREE.Matrix4().lookAt( align.Ox , new THREE.Vector3(0,0,0), new THREE.Vector3(0,1,0) );
var my = new THREE.Matrix4().lookAt( align.Oy , new THREE.Vector3(0,0,0), new THREE.Vector3(1,0,0) );
mx.multiply(my);
var qt = new THREE.Quaternion().setFromRotationMatrix(mx);
my_mesh.matrix.makeRotationFromQuaternion(qt);
}
// move
mesh.matrix.setPosition( align.move );
mesh.matrixAutoUpdate = false;
It seems like this might lead to the solution?
EDIT
After reading West's answer, I realize that I mislabeled this as a 'coordinates system' since the vectors are not orthogonal.
Below are some records after rotations (where 'z30' denotes a 30° rotation around Oz).. What I previously referred to as Oz is always represented as {x: 0, y: 0, z: 1}
// base
Ox: {x: 1, y: 0, z: 0}
Oy: {x: 0, y: 1, z: 0}
move: {x: 6.42995404746696, y: -500, z: -268.028464077285}
// base x45
Ox: {x: 1, y: 0, z: 0}
Oy: {x: 0, y: -0.707106781186548, z: 0.707106781186547}
move: {x: 6.42995404746696, y: -73.2233047033605, z: -444.805159373921}
// base y60
Ox: {x: 0.500000000000001, y: 0, z: 0.866025403784438}
Oy: {x: 0, y: 1, z: 0}
move: {x: 6.42995404746766, y: -500, z: -268.028464077285}
// base z30
Ox: {x: 0.866025403784439, y: 0.5, z: 0}
Oy: {x: 0.5, y: -0.866025403784439, z: 0}
move: {x: -118.570045952533, y: -33.4936490538881, z: -268.028464077284}
// base z30 x45
Ox: {x: 0.866025403784439, y: 0.353553390593274, z: -0.353553390593273}
Oy: {x: 0.5, y: -0.612372435695795, z: 0.612372435695794}
move: {x: -118.570045952533, y: -96.9068910760492, z: -421.121573001233}
// base z30 x45 y60
Ox: {x: 0.739198919740117, y: 0.353553390593274, z: 0.573223304703363}
Oy: {x: 0.28033008588991, y: 0.612372435695795, z: -0.739198919740117}
move: {x: -63.6525674250102, y: -403.093108923947, z: -83.228734142255}