I have a question, whether the count of postion vertex must be the same as the count of texture coordinate 。for example 5 texture coordinate, must 5 vertices? can I use index to point the same position vertices like obj file?
In a glTF model the position accessor and texture coordinate accessor will usually have the same count. 5 vertices means 5 positions and 5 texture coordinates. If the source model has more texture coordinates than positions some positions may be duplicated so that all vertices can be described.
OBJ is different than glTF in that each vertex contains multiple indexes - one for position, one for texcoord, and one for normal - and each attribute array can be a different length. This isn’t the case in glTF where an index is the same index for all vertex attributes.
can I use index to point the same position vertices like obj file?
Yes, you can use the same index multiple times to point to the same vertices. For example the indices for a rectangle might be 0, 1, 2, 0, 2, 3.