For my model viewer I want to display some basic info about the model. Basically I want to get the vertex, edge, face and triangle count of my object or at minimum the vertex count.
I've tried doing it this way so far:
gltf.scene.traverse( function ( child ) {
if ( child.isMesh ) {
console.log(child.geometry.vertices)
}
})
However this returns undefinded and therefore does not seem to work. The geometry part is of the Type BufferGeometry however I do not seem to find a way to get the information I need.
I've also tried using this:
console.log(child.geometry.attributes.position.count)
Which does infact return some number.. however I have no idea if this is the vertex count or something else entirely.
How can I get the vertex count of my model and ideally also edges, faces and triangles?