根據傳入的GLTF字串構建Scene對象。
文法
scene ST_SceneFromGltf(cstring gltf,
integer srid default 0,
integer lod default 0);
scene ST_SceneFromGltf(cstring gltf,
integer srid,
integer lod,
float8[] affine);參數
| 參數名稱 | 描述 |
| gltf | 基於字串表示的gltf。 |
| srid | 空間參考ID,預設值為0。 |
| lod | LOD層級,預設值為0。 |
| affine | 仿射變換數組,參數數量必須是12或16。如果是16個參數,最後4個參數會被忽略。 |
描述
根據傳入的GLTF字串構建Scene對象。
對於仿射變換矩陣Affine:
/ p[1] p[2] p[3] p[4] \
| p[5] p[6] p[7] p[8] |
\ p[9] p[10] p[11] p[12] /每一個座標點執行以下變換操作:
x' = p[1]*x + p[2]*y + p[3]*z + p[4]
y' = p[5]*x + p[6]*y + p[7]*z + p[8]
z' = p[9]*x + p[10]*y + p[11]*z + p[12]樣本
- 樣本一:
SELECT ST_AsText(ST_sceneFromGLTF('{"accessors": ... }')); -------------- {"type" : "gltf", "content" : {"accessors":...}} - 樣本二:
SELECT ST_AsText(ST_sceneFromGLTF('{"accessors": ... }', 4326)); -------------- {"type" : "gltf", "srid" : 4326, "content" : {"accessors":...}} - 樣本三:
SELECT ST_AsText(ST_sceneFromGLTF('{"accessors": ... }', 4326, 1)); -------------- {"type" : "gltf", "srid" : 4326, "lod" : 1, "content" : {"accessors":...}} - 樣本四:
SELECT ST_AsText(ST_sceneFromGLTF('{"accessors": ... }', 4326, 1,ARRAY[0.5, 0, 0, 1, 0, 0.5, 0, 1, 0, 0, 0.5, 1]::float8[])); -------------- {"type" : "gltf", "srid" : 4326, "lod" : 1, "affine" : [0.5,0,0,1,0,0.5,0,1,0,0,0.5,1,0,0,0,1], "content" : {"accessors":...}}