ST_SetMaterial

更新时间: 2026-03-28 09:48:53

Sets the material at the specified index position in an sfmesh object.

Syntax

sfmesh ST_SetMaterial(sfmesh sfmeshObject, int4 index, material materialObject);

Parameters

ParameterDescription
sfmeshObjectThe sfmesh object.
indexThe index of the material to set. The index is zero-based.
materialObjectThe material object to assign.

Examples

SELECT ST_SetMaterial(
  '{"meshgeoms":["MESHGEOM(PATCH(TRIANGLESTRIP(0 0,0 10,10 10,10 0)))"],"materials":[{"type":"db","attributes":{"schema":"public","table":"t_material","column":"the_material","key":"num=1"}}],"primitives":[{"meshgeom":0,"material":0}],"nodes":[{"primitive" : 0}]}'::sfmesh,
  0,
  '{"type":"db","attributes":{"schema":"public","table":"t_material","column":"the_material","key":"num=10"}}'
);
上一篇: ST_MaterialN 下一篇: ST_TextureN
阿里云首页 云原生数据库 PolarDB 相关技术圈