ST_AsGLTF

更新时间:
复制 MD 格式

Converts a scene object or OSG object to a GL Transmission Format (glTF) string.

Syntax

text ST_AsGLTF(scene sceneObject);

Parameters

ParameterTypeDescription
sceneObjectsceneThe scene object to convert. Accepts both native scene objects and OpenSceneGraph (OSG) objects.

Description

ST_AsGLTF serializes a 3D scene into a glTF string. The sceneObject parameter accepts two categories of input:

  • Scene objects: native scene graph objects stored in PolarDB using the scene type.

  • OSG objects: objects originating from OpenSceneGraph (OSG), also stored as scene type values.

The return type is text, containing a glTF structure that you can pass to a glTF-compatible renderer or write to a file.

Examples

Convert a scene object to a glTF string:

SELECT ST_AsGLTF(ST_sceneFromText('{"type" : "gltf", "content" : {"accessors":...}}'));

Output:

{"accessors":...}}