This topic describes the ST_YupToZup function. This function converts a model from Y-up coordinate system to Z-up coordinate system.
Syntax
sfmesh ST_YupToZup(sfmesh mesh);
Return value
The sfmesh object that is obtained after the Y and Z axes are flipped.
Parameters
Parameter | Description |
sfmesh | The sfmesh object that you want to convert. |
Description
This function flips the Y and Z axes of the sfmesh object. In some cases, you can call this function to convert a Y-up coordinate system to a Z-up coordinate system.
You can also call the ST_Affine function and perform the following matrix transformation operations to implement the conversion:
1.0, 0, 0, 0,
0, 0, 1.0, 0,
0, -1.0,0, 0
Examples
SELECT ST_AsText(ST_YupToZup(ST_MeshFromText('{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(INDEXSURFACE Z (VERTEX(0 0 2,0 10 3,10 10 1,10 0 1),INDEX((0,1,2),(1,2,3)))))"], "primitives" : [{"meshgeom" : 0}], "nodes" : [{"primitive" : 0}]}')));
Result:
{"version" : 1, "root" : 0, "meshgeoms" : ["MESHGEOM(PATCH(INDEXSURFACE Z (VE
RTEX(0 0 2,0 10 3,10 10 1,10 0 1),INDEX((0,1,2),(1,2,3)))))"], "primitives" :
[{"meshgeom" : 0}], "nodes" : [{"primitive" : 0,"matrix" : [1,0,0,-1,0,0,0,0,1
,0,0,0,0,0,0,1]}]}