ypp писал(а):
На сколько мне извесно, chunk-ов с вершинами есть только по 1 на каждый мэш.
Это не очевидно, и может так и не быть, кроме этого количество мешей тоже не задается.
Код:
Before you worry about reading in this data, you need a place to store
it. That is where the S3dsMesh structure comes in. Each S3dsMesh structure
holds one triangular mesh. Because the file does not reveal how
many meshes there are total, you can call on the power of STL and
std::vector to create a place to store any number of meshes.
А вот про вершины:
Код:
The rest of the data is contained in sub-chunks of the 0x4100 chunk.
(Yes, you can have sub-chunks of sub-chunks!) Because you do not
know how many vertices, faces, or materials there will be, you may want
to use a std::vector. This is essentially a resizable array. Using
std::vectors, you can add as many objects to your array as you like
without allocating or resizing it. If you aren’t sure about how to use
std::vectors, I suggest you skip to Appendix B.
Во всяком случае я исходил из этого. Хотя я видел код, в котором считается что 0x4100 chunk один на меш. Но подумал, что это может быть в общем случае и не верно.
Для программиста вообще лучше перебдеть, чем не добдеть

.