Converts a scene object or OSG object to a GL Transmission Format (glTF) string.
Syntax
text ST_AsGLTF(scene sceneObject);Parameters
| Parameter | Type | Description |
|---|---|---|
sceneObject | scene | The 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
scenetype.OSG objects: objects originating from OpenSceneGraph (OSG), also stored as
scenetype 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":...}}该文章对您有帮助吗?