THREEJS: matrix from Z-Up coordinate system to Y-Up coordinate system

I am trying to export a series of transformation matrices to animate objects in ThreeJS. These conversions are extracted from the Rhino, Z-Up Modeler and should be placed in ThreeJS, which is Y-Up. I found a similar question on this site, but the answer seems to be wrong, because my conversions are not portable.

Can someone translate the general 4x4 matrix below from the Z-Up coordinate system to the Y-Up coordinate system?

{ a, b, c, d }  
{ e, f, g, h }  
{ i, j, k, l }  
{ m, n, o, p }
0
source share
1 answer

Ok, I think I have a working solution:

Z Up ( YZ ), THREEjs YZ ():

        objectid.matrixWorldNeedsUpdate=true;                               
        objectid.matrix.set 
        (
            1,  0,  0,  0,
            0,  0,  1,  0,
            0,  -1, 0,  0,
            0,  0,  0,  1
        );
        objectid.updateMatrixWorld();  

, this, . :

{ a, b, c, d }  
{ e, f, g, h }  
{ i, j, k, l }  
{ m, n, o, p }

{ a, c, b, d }  
{ i, k, j, l }  
{ e, g, f, h }  
{ m, o, n, p }

YZ, OBJ Rhino, . , javascript YZ.

+1

Source: https://habr.com/ru/post/1679636/


All Articles