本文介绍了实景模型的用途、基本构成以及快速入门等内容。
模型用途
简介
实景模型是一种以分析、渲染为主要用途的三维模型存储结构,Ganos Scene是对象关系型数据库PostgreSQL兼容版本(PolarDB PostgreSQL版(兼容Oracle))的一个时空引擎扩展,它保留了三维模型的一切信息,包括:材质、纹理、骨骼、动画等,力争最大程度还原模型本身的各类信息。
功能概述
Scene原生支持倾斜摄影、glTF等场景数据入库一体化管理。引擎采用了多级数据视图的组合关联技术,解决了超大对象存储和高效存取难题。
Scene增强了对地心坐标系(ECEF)、站心坐标系(ENU)的支持,实现地理坐标数据与三维实景数据的一体化处理与分析。
Scene支持三维实景数据的空间关系判断、闭合裁剪、几何简化、纹理重组等操作,能够达到城市级海量三维实景数据的秒级提取呈现。
Scene兼容多种外部格式的直接输入,如:OSGB、GLTF、GLB等格式。
功能详情请参见Scene SQL参考。
主要业务场景
在实际应用中,Scene可以用于三维空间数据的存储、分析和可视化:
倾斜摄影数据管理和可视化
倾斜摄影数据管理一直是测绘信息领域的重要工作,大多用于三维底图的展示。基于Ganos Scene类型可以实现倾斜摄影数据的导入-存储-计算-渲染支持全套方案,在不造成数据冗余的情况下,构建了视算一体的“空间数据一库统管”能力。此外,Ganos支持将数据保留至对象存储,仅在库内构建类型,这种情况下依然可以对倾斜摄影对象开展各类空间查询、分析与渲染操作,可以有效地降低用户成本。
空间数据挖掘
Ganos Scene提供了完备的跨模空间关系查询能力,可以用于空间数据挖掘等多种场景。如查询多个建筑物之间是否有重叠(判断两个三维空间对象之间的相交关系)、某个建筑物周围或某个地理范围内的其他建筑物(判断两个三维空间对象之间的包含关系)等,还可以从三维场景中提取出感兴趣的区域或对象(如园区中的单个建筑物,包含几何形状、表面属性等信息),以支持后续的分析和应用。
园区/城市管理与规划
Ganos Scene提供了先进的空间分析能力,如可视域分析与阴影率分析,可以直接在数据库内进行计算分析以支持更加复杂的业务场景,摆脱了对前端GPU的依赖。可视域分析能力可以应用于辅助园区内摄像头的布设、重大活动重点路线安保规划等场景,阴影率分析能力可以应用于建筑或太阳能电站选址、设计等场景,帮助设计者和决策者实现科学规划与管理。此外,Ganos Scene还提供了三维模型简化、纹理裁剪与简化等轻量化能力,可以提高计算效率,加快前端的渲染速度,更好地服务于上层应用。
基本构成
概述
在Ganos中,Scene模型包含了glTF、OSGB两种标准数据类型。一般是基于遥感测绘、智能感知等新型技术手段,对真实物理世界的场景进行三维虚拟重建,包括倾斜摄影数据、三维表面建模数据等,具有数据规模大、显示属性多、自定义结构复杂等特性。Scene类型实现了数据资产集约化管理,解决大规模三维真实场景检索、分析效率慢、超大型三维模型“只能看,算不动”等问题,可以支持复杂的空间查询与分析。常用于城市的数字化底座,虚拟现实等场景。
类型
glTF 类型
glTF(Graphics Language Transmission Format)是一种3D文件格式,以JSON格式存储3D模型信息,旨在减少3D资产的大小以及解压和使用这些资产所需的处理时间。glTF文件可以使用.gltf(JSON/ASCII)扩展名或.glb(二进制)扩展名,无论是.gltf还是.glb文件都可以引用外部的二进制数据和纹理资源。glTF支持描述3D模型的几何形状、外观、场景层次结构和动画等,被广泛应用于3D场景、模型的高效传输和加载。
glTF这种跨平台格式已成为Web上的3D对象标准。它由OpenGL和Vulkan背后的3D图形标准组织Khronos所定义,这使得glTF基本上成为3D模型的JPG格式:Web导出的通用标准。
OSGB 类型
OSGB(OpenSceneGraph Binary)是一种二进制文件格式,用于存储三维图形和场景数据。它是OpenSceneGraph(一种开源的三维图形渲染引擎)中使用的默认文件格式之一。OSGB包含了场景的几何形状、材质、纹理、光照、动画等数据,提供了高效的数据存储和读取性能,同时支持压缩和随机访问。OSGB可以被OpenSceneGraph引擎加载和渲染,以创建交互式的三维图形应用程序,被广泛用于视觉模拟、游戏、虚拟现实、科学可视化和建模等领域。
空间参考系
空间参考系(Spatial Reference System,以下简称为SRS )定义了如何将Scene对象关联到地球表面上某个具体位置。
Ganos使用一个整数来表示SRS的定义引用,称为SRID。Scene对象通过其自身的SRID值与SRS关联。
更多内容请参见空间参考。
数据列视图
在Ganos中,scene_columns是从数据库系统目录表中读取全部Scene类型相关列的视图。该视图遵循了OGC的Simple Features Specification for SQL标准并进行可对应的扩展。 该视图结构如下:
列名 | 类型 | 说明 |
f_table_catalog | varchar(256) | 所在数据库的名称。 |
f_table_schema | name | 该表所在的schema。 |
f_table_name | name | 该表的表名。 |
f_scene_column | name | 该表中某个Scene类型列的列名。 |
可以通过如下语句查询当前数据库中全部Scene类型数据列:
SELECT * FROM scene_columns;
索引
空间索引使Ganos处理大型空间数据集时避免对数据库进行全局“顺序扫描”。索引通过将数据组织到搜索树中来加速搜索,可以快速遍历该搜索树以查找特定记录。
Ganos为Scene数据提供了GiST空间索引:
索引名称 | 索引说明 | 索引特点 |
GiST (Generalized Search Tree) | GiST索引基于模型外包框提供了相交、包含等空间关系的快速查询。 | GiST是最常用、最通用的空间索引方法,提供非常好的查询性能。 |
可通过以下方式创建索引:
CREATE INDEX <index_name>
ON <table_name>
USING GIST(<column_name>);
快速入门
简介
快速入门文档帮助用户快速理解Ganos Scene引擎的基本用法,包括扩展创建、建表、插入数据、查询结果、创建索引、空间查询等内容。
更多专业用法可参考Scene最佳实践文章:
语法说明
创建扩展。
CREATE EXTENSION Ganos_scene CASCADE;
说明建议将扩展安装在public模式下,避免权限问题。
CREATE extension Ganos_scene WITH schema public cascade;
创建具有Scene字段的表。
CREATE TABLE t_scene( id integer, data scene );
插入数据。
--向表中插入数据 INSERT INTO t_scene(id, data) VALUES (1, '{"type" : "gltf", "affine" : [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1], "content" : {"accessors":[{"bufferView":0,"componentType":5126,"count":42,"max":[1.0,1.0,1.0],"min":[-1.0,-1.0,-1.0],"type":"VEC3"},{"bufferView":1,"componentType":5126,"count":42,"max":[1.0,1.0,1.0],"min":[-1.0,-1.0,-1.0],"type":"VEC3"},{"bufferView":2,"componentType":5126,"count":42,"max":[0.0],"min":[0.0],"type":"SCALAR"},{"bufferView":3,"componentType":5121,"count":240,"max":[41],"min":[0],"type":"SCALAR"}],"asset":{"generator":"Ganos Scene","version":"2.0"},"bufferViews":[{"buffer":0,"byteLength":504,"target":34962},{"buffer":0,"byteLength":504,"byteOffset":504,"target":34962},{"buffer":0,"byteLength":168,"byteOffset":1008,"target":34962},{"buffer":0,"byteLength":240,"byteOffset":1176,"target":34963}],"buffers":[{"byteLength":1416,"uri":"data:application/octet-stream;base64,AAAAAAAAgD8AAAAAAAAAP70bTz96N54+AAAAP70bTz96N56+AAAAAEDEWT9Qlga/AAAAAEDEWT9QlgY/QMRZP1CWBj8AAAAAAAAAv70bTz96N56+AAAAv70bTz96N54+QMRZv1CWBj8AAAAAAAAAAAAAgL8AAAAAAAAAP70bT796N56+AAAAP70bT796N54+AAAAAEDEWb9QlgY/AAAAAEDEWb9Qlga/QMRZP1CWBr8AAAAAAAAAv70bT796N54+AAAAv70bT796N56+QMRZv1CWBr8AAAAAAACAPwAAAAAAAAAAvRtPP3o3nr4AAAC/vRtPP3o3nj4AAAC/UJYGPwAAAABAxFm/vRtPP3o3nj4AAAA/vRtPP3o3nr4AAAA/UJYGPwAAAABAxFk/AACAvwAAAAAAAAAAvRtPv3o3nr4AAAA/vRtPv3o3nj4AAAA/UJYGvwAAAABAxFk/vRtPv3o3nj4AAAC/vRtPv3o3nr4AAAC/UJYGvwAAAABAxFm/AAAAAAAAAAAAAIA/ejeevgAAAL+9G08/ejeePgAAAL+9G08/ejeePgAAAD+9G08/ejeevgAAAD+9G08/AAAAAAAAAAAAAIC/ejeevgAAAD+9G0+/ejeePgAAAD+9G0+/ejeePgAAAL+9G0+/ejeevgAAAL+9G0+/AAAAAAAAgD8AAAAAAQAAP70bTz96N54+AQAAP70bTz96N56+AAAAAEDEWT9Rlga/AAAAAEDEWT9RlgY/QMRZP1KWBj8AAAAAAQAAv70bTz96N56+AQAAv70bTz96N54+QMRZv1KWBj8AAAAAAAAAAAAAgL8AAAAAAQAAP70bT796N56+AQAAP70bT796N54+AAAAAEDEWb9RlgY/AAAAAEDEWb9Rlga/QMRZP1KWB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{"nodes":[0]}]}}'::scene), (2, '{"type" : "gltf", "affine" : [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1], "content" : {"accessors":[{"bufferView":0,"componentType":5121,"count":36,"max":[7],"min":[0],"type":"SCALAR"},{"bufferView":1,"componentType":5126,"count":8,"max":[2.5,0.5,0.5],"min":[1.5,-0.5,-0.5],"type":"VEC3"}],"asset":{"generator":"ganos","version":"2.0"},"bufferViews":[{"buffer":0,"byteLength":36,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":36,"target":34962}],"buffers":[{"byteLength":132,"uri":"data:application/octet-stream;base64,AgEAAQIDBAIAAgQGAQQABAEFBgUHBQYEAwYHBgMCBQMHAwUBAADAPwAAAL8AAAC/AAAgQAAAAL8AAAC/AADAPwAAAD8AAAC/AAAgQAAAAD8AAAC/AADAPwAAAL8AAAA/AAAgQAAAAL8AAAA/AADAPwAAAD8AAAA/AAAgQAAAAD8AAAA/"}],"meshes":[{"primitives":[{"attributes":{"POSITION":1},"indices":0,"mode":4}]}],"nodes":[{"mesh":0}],"scenes":[{"nodes":[0]}]}}'::scene), (3, '{"type" : "gltf", "affine" : [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1], "content" : {"accessors":[{"bufferView":0,"componentType":5121,"count":36,"max":[7],"min":[0],"type":"SCALAR"},{"bufferView":1,"componentType":5126,"count":8,"max":[6.5,0.5,0.5],"min":[5.5,-0.5,-0.5],"type":"VEC3"}],"asset":{"generator":"ganos","version":"2.0"},"bufferViews":[{"buffer":0,"byteLength":36,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":36,"target":34962}],"buffers":[{"byteLength":132,"uri":"data:application/octet-stream;base64,AgEAAQIDBAIAAgQGAQQABAEFBgUHBQYEAwYHBgMCBQMHAwUBAACwQAAAAL8AAAC/AADQQAAAAL8AAAC/AACwQAAAAD8AAAC/AADQQAAAAD8AAAC/AACwQAAAAL8AAAA/AADQQAAAAL8AAAA/AACwQAAAAD8AAAA/AADQQAAAAD8AAAA/"}],"meshes":[{"primitives":[{"attributes":{"POSITION":1},"indices":0,"mode":4}]}],"nodes":[{"mesh":0}],"scenes":[{"nodes":[0]}]}}'::scene);
查询数据结果。
SELECT id, ST_AsText(data) FROM t_scene; ------------------------- 1 | {"type" : "gltf", "affine" : [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1], "content" : {"accessors":[{"bufferView":0,"componentType":5126,"count":42,"max":[1.0,1.0,1.0],"min":[-1.0,-1.0,-1.0],"type":"VEC3"},{"bufferView":1,"componentType":5126,"count":42,"max":[1.0,1.0,1.0],"min":[-1.0,-1.0,-1.0],"type":"VEC3"},{"bufferView":2,"componentType":5126,"count":42,"max":[0.0],"min":[0.0],"type":"SCALAR"},{"bufferView":3,"componentType":5121,"count":240,"max":[41],"min":[0],"type":"SCALAR"}],"asset":{"generator":"Ganos Scene","version":"2.0"},"bufferViews":[{"buffer":0,"byteLength":504,"target":34962},{"buffer":0,"byteLength":504,"byteOffset":504,"target":34962},{"buffer":0,"byteLength":168,"byteOffset":1008,"target":34962},{"buffer":0,"byteLength":240,"byteOffset":1176,"target":34963}],"buffers":[{"byteLength":1416,"uri":"data:application/octet-stream;base64,AAAAAAAAgD8AAAAAAAAAP70bTz96N54+AAAAP70bTz96N56+AAAAAEDEWT9Qlga/AAAAAEDEWT9QlgY/QMRZP1CWBj8AAAAAAAAAv70bTz96N56+AAAAv70bTz96N54+QMRZv1CWBj8AAAAAAAAAAAAAgL8AAAAAAAAAP70bT796N56+AAAAP70bT796N54+AAAAAEDEWb9QlgY/AAAAAEDEWb9Qlga/QMRZP1CWBr8AAAAAAAAAv70bT796N54+AAAAv70bT796N56+QMRZv1CWBr8AAAAAAACAPwAAAAAAAAAAvRtPP3o3nr4AAAC/vRtPP3o3nj4AAAC/UJYGPwAAAABAxFm/vRtPP3o3nj4AAAA/vRtPP3o3nr4AAAA/UJYGPwAAAABAxFk/AACAvwAAAAAAAAAAvRtPv3o3nr4AAAA/vRtPv3o3nj4AAAA/UJYGvw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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAECAwACBAEABQIBAAYHBAAHAwYACAcGCQoLDAkLDQoJDgsKCQ8QDQkQDA8JERAPEhMUBRIUDhMSFRQTEhYXDhIXBRYSGBcWGRobCBkbERoZHBsaGR0eERkeCB0ZHx4dICEiGCAiHCEgDCIhICMkHCAkGCMgBCQjJSYnFSUnHyYlAycmJSgpHyUpFSglDSkoIxYBBCMBGBYjBQEWBxskBAckCBsHHCQbAhQnAwInBRQCFScUJh0GAyYGHx0mCAYdCxciDAsiDhcLGCIXIRoPDCEPHBohEQ8aKBMKDSgKFRMoDgoTEB4pDRApER4QHyke"}],"meshes":[{"primitives":[{"attributes":{"NORMAL":1,"POSITION":0,"_USER_1":2},"indices":3,"mode":4}]}],"nodes":[{"mesh":0}],"scenes":[{"nodes":[0]}]}} 2 | {"type" : "gltf", "affine" : [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1], "content" : {"accessors":[{"bufferView":0,"componentType":5121,"count":36,"max":[7],"min":[0],"type":"SCALAR"},{"bufferView":1,"componentType":5126,"count":8,"max":[2.5,0.5,0.5],"min":[1.5,-0.5,-0.5],"type":"VEC3"}],"asset":{"generator":"ganos","version":"2.0"},"bufferViews":[{"buffer":0,"byteLength":36,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":36,"target":34962}],"buffers":[{"byteLength":132,"uri":"data:application/octet-stream;base64,AgEAAQIDBAIAAgQGAQQABAEFBgUHBQYEAwYHBgMCBQMHAwUBAADAPwAAAL8AAAC/AAAgQAAAAL8AAAC/AADAPwAAAD8AAAC/AAAgQAAAAD8AAAC/AADAPwAAAL8AAAA/AAAgQAAAAL8AAAA/AADAPwAAAD8AAAA/AAAgQAAAAD8AAAA/"}],"meshes":[{"primitives":[{"attributes":{"POSITION":1},"indices":0,"mode":4}]}],"nodes":[{"mesh":0}],"scenes":[{"nodes":[0]}]}} 3 | {"type" : "gltf", "affine" : [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1], "content" : {"accessors":[{"bufferView":0,"componentType":5121,"count":36,"max":[7],"min":[0],"type":"SCALAR"},{"bufferView":1,"componentType":5126,"count":8,"max":[6.5,0.5,0.5],"min":[5.5,-0.5,-0.5],"type":"VEC3"}],"asset":{"generator":"ganos","version":"2.0"},"bufferViews":[{"buffer":0,"byteLength":36,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":36,"target":34962}],"buffers":[{"byteLength":132,"uri":"data:application/octet-stream;base64,AgEAAQIDBAIAAgQGAQQABAEFBgUHBQYEAwYHBgMCBQMHAwUBAACwQAAAAL8AAAC/AADQQAAAAL8AAAC/AACwQAAAAD8AAAC/AADQQAAAAD8AAAC/AACwQAAAAL8AAAA/AADQQAAAAL8AAAA/AACwQAAAAD8AAAA/AADQQAAAAD8AAAA/"}],"meshes":[{"primitives":[{"attributes":{"POSITION":1},"indices":0,"mode":4}]}],"nodes":[{"mesh":0}],"scenes":[{"nodes":[0]}]}}
创建索引。
CREATE INDEX idx_t_scene ON t_scene USING GIST(data);
空间查询。
-- 与某个三维空间对象相交 SELECT id FROM t_scene WHERE ST_3DIntersects(data, ST_3DMakeCuboid(3, 3, 3)); ------------------------- 2 -- 包含在某个三维空间对象中 SELECT id FROM t_scene WHERE ST_Contains(ST_3DMakeCuboid(3, 3, 3), data); ------------------------- 1
空间计算。
-- 与某个三维空间对象的intersection SELECT ST_asText(ST_Intersection(data, ST_3DMakeCuboid(3, 3, 3))) FROM t_scene WHERE id = 2; ------------------------- {"type" : "gltf", "affine" : [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1], "content" : {"accessors":[{"bufferView":0,"componentType":5126,"count":6,"max":[1.5,0.5,0.5],"min":[1.5,-0.5,-0.5],"type":"VEC3"},{"bufferView":1,"componentType":5126,"count":6,"max":[-1.0,0.0,0.0],"min":[-1.0,0.0,0.0],"type":"VEC3"},{"bufferView":2,"componentType":5121,"count":6,"max":[5],"min":[0],"type":"SCALAR"}],"asset":{"generator":"ganos","version":"2.0"},"bufferViews":[{"buffer":0,"byteLength":72,"target":34962},{"buffer":0,"byteLength":72,"byteOffset":72,"target":34962},{"buffer":0,"byteLength":8,"byteOffset":144,"target":34963}],"buffers":[{"byteLength":152,"uri":"data:application/octet-stream;base64,AADAPwAAAL8AAAA/AADAPwAAAD8AAAC/AADAPwAAAL8AAAC/AADAPwAAAD8AAAC/AADAPwAAAL8AAAA/AADAPwAAAD8AAAA/AACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAACAvwAAAAAAAAAAAAECAwQFAAA="}],"meshes":[{"primitives":[{"attributes":{"NORMAL":1,"POSITION":0},"indices":2,"mode":4}]}],"nodes":[{"mesh":0}],"scenes":[{"nodes":[0]}]}} -- 多个gltf类型的scene对象合并成一个 SELECT ST_asText(ST_Combine(data)) FROM t_scene; ------------------------- {"type" : "gltf", "affine" : [1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1], "content" : {"accessors":[{"bufferView":0,"componentType":5126,"count":42,"max":[1.0,1.0,1.0],"min":[-1.0,-1.0,-1.0],"type":"VEC3"},{"bufferView":1,"componentType":5126,"count":42,"max":[1.0,1.0,1.0],"min":[-1.0,-1.0,-1.0],"type":"VEC3"},{"bufferView":2,"componentType":5126,"count":42,"max":[0.0],"min":[0.0],"type":"SCALAR"},{"bufferView":3,"componentType":5121,"count":240,"max":[41],"min":[0],"type":"SCALAR"},{"bufferView":4,"componentType":5121,"count":36,"max":[7],"min":[0],"type":"SCALAR"},{"bufferView":5,"componentType":5126,"count":8,"max":[2.5,0.5,0.5],"min":[1.5,-0.5,-0.5],"type":"VEC3"},{"bufferView":6,"componentType":5121,"count":36,"max":[7],"min":[0],"type":"SCALAR"},{"bufferView":7,"componentType":5126,"count":8,"max":[6.5,0.5,0.5],"min":[5.5,-0.5,-0.5],"type":"VEC3"}],"asset":{"generator":"Ganos Scene","version":"2.0"},"bufferViews":[{"buffer":0,"byteLength":504,"target":34962},{"buffer":0,"byteLength":504,"byteOffset":504,"target":34962},{"buffer":0,"byteLength":168,"byteOffset":1008,"target":34962},{"buffer":0,"byteLength":240,"byteOffset":1176,"target":34963},{"buffer":0,"byteLength":36,"byteOffset":1416,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":1452,"target":34962},{"buffer":0,"byteLength":36,"byteOffset":1548,"target":34963},{"buffer":0,"byteLength":96,"byteOffset":1584,"target":34962}],"buffers":[{"byteLength":1680,"uri":"data:application/octet-stream;base64,AAAAAAAAgD8AAAAAAAAAP70bTz96N54+AAAAP70bTz96N56+AAAAAEDEWT9Qlga/AAAAAEDEWT9QlgY/QMRZP1CWBj8AAAAAAAAAv70bTz96N56+AAAAv70bTz96N54+QMRZv1CWBj8AAAAAAAAAAAAAgL8AAAAAAAAAP70bT796N56+AAAAP70bT796N54+AAAAAEDEWb9QlgY/AAAAAEDEWb9Qlga/QMRZP1CWBr8AAAAAAAAAv70bT796N54+AAAAv70bT796N56+QMRZv1CWBr8AAAAAAACAPwAAAAAAAAAAvRtPP3o3nr4AAAC/vRtPP3o3nj4AAAC/UJYGPwAAAABAxFm/vRtPP3o3nj4AAAA/vRtPP3o3nr4AAAA/UJYGPwAAAABAxFk/AACAvwAAAAAAAAAAvRtPv3o3nr4AAAA/vRtPv3o3nj4AAAA/UJYGvwAAAABAxFk/vRtPv3o3nj4AAAC/vRtPv3o3nr4AAAC/UJYGvwAAAABAxFm/AAAAAAAAAAAAAIA/ejeevgAAAL+9G08/ejeePgAAAL+9G08/ejeePgAAAD+9G08/ejeevgAAAD+9G08/AAAAAAAAAAAAAIC/ejeevgAAAD+9G0+/ejeePgAAAD+9G0+/ejeePgAAAL+9G0+/ejeevgAAAL+9G0+/AAAAAAAAgD8AAAAAAQAAP70bTz96N54+AQAAP70bTz96N56+AAAAAEDEWT9Rlga/AAAAAEDEWT9RlgY/QMRZP1KWBj8AAAAAAQAAv70bTz96N56+AQAAv70bTz96N54+QMRZv1KWBj8AAAAAAAAAAAAAg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gQGAQQABAEFBgUHBQYEAwYHBgMCBQMHAwUBAADAPwAAAL8AAAC/AAAgQAAAAL8AAAC/AADAPwAAAD8AAAC/AAAgQAAAAD8AAAC/AADAPwAAAL8AAAA/AAAgQAAAAL8AAAA/AADAPwAAAD8AAAA/AAAgQAAAAD8AAAA/AgEAAQIDBAIAAgQGAQQABAEFBgUHBQYEAwYHBgMCBQMHAwUBAACwQAAAAL8AAAC/AADQQAAAAL8AAAC/AACwQAAAAD8AAAC/AADQQAAAAD8AAAC/AACwQAAAAL8AAAA/AADQQAAAAL8AAAA/AACwQAAAAD8AAAA/AADQQAAAAD8AAAA/"}],"meshes":[{"primitives":[{"attributes":{"NORMAL":1,"POSITION":0,"_USER_1":2},"indices":3,"mode":4}]},{"primitives":[{"attributes":{"POSITION":5},"indices":4,"mode":4}]},{"primitives":[{"attributes":{"POSITION":7},"indices":6,"mode":4}]}],"nodes":[{"mesh":0},{"mesh":1},{"mesh":2}],"scenes":[{"nodes":[0]},{"nodes":[1]},{"nodes":[2]}]}}
删除扩展(可选)。
DROP EXTENSION Ganos_Scene CASCADE;
SQL参考
详细SQL手册请参见Scene SQL参考。