I am testing out getting vertex normals from gltf models. My understanding is that there is one normal per vertex, however when I draw them with arrows, I’m getting 3 normals per vertex. (image below)
My understanding is that the BufferGeometry assembled from the GLTF is indexed right? So surely there should only be 8 vertices and vertex normals, that are grabbed using the index to make triangles. Why do I have 24 vertices and vertex normals?
It seems like there is something fundamental that I can’t get my head around…
As @alessandro_guarino mentions, this is in order to provide sharp edges. You are correct that each vertex can have only one normal vector, and so hard edges require 2 or more vertices — with different normals — at the same position.
A BufferGeometry assembled by GLTFLoader may or may not be indexed, depending on the glTF file… I would guess that most tools create indexed glTF files by default, on the assumption that at least some vertices may be shared, but it probably doesn’t matter much for this box.