Centroid of GLTF mesh

I've been using this logic for find the centroid of a GLTF mesh, but it would work with any model I imagine:

Matrix4.multiplyByPoint(model.modelMatrix, model.boundingSphere.center, new Cartesian3())

Unfortunately, if I'm rendering a GLTF mesh I don't have the vertices or triangles and can't use those to create a concave hull and find the centroid that way. I'm forced to use the COLLADA origin which is returned by the code above and assume it's correct. Is there an alternative way to find either the vertices in a model after construction?


It will be a bit of work, but you could access the model’s gltf property and then trace through the node/mesh/accessor/bufferview/buffer.