Buffer Offsets and Indexes

I was wondering what kind of "offset" and "index / index". Offsets are, for example, mentioned in https://github.com/mrdoob/three.js/blob/dev/src/core/BufferGeometry.js , and the indices were mentioned in IndexedGeometry, however I can no longer find it in the dev tree . Although the indices seem pretty obvious, and although I could dive into the code to find out some, maybe the right answer for myself, I would like to hear an “official” expression :)

Thank!

+4
source share
1 answer

There are two ways to define geometry:

Not indexed

"vertices": [ 0, 1, 2,  3, 4, 5,  6, 7, 8,  ... ],
"normals":  [ 0, 1, 2,  3, 4, 5,  6, 7, 8,  ... ]

, .

triangle 0: [ 0, 1, 2,  3, 4, 5,  6, 7, 8 ]

"indices":  [ 0, 1, 2, ... ],
"vertices": [ 0, 1, 2,  3, 4, 5,  6, 7, 8,  ... ],
"normals":  [ 0, 1, 2,  3, 4, 5,  6, 7, 8,  ... ]

. 0, 1 2. vertices normals:

triangle 0: [ 0, 1, 2,  3, 4, 5,  6, 7, 8 ]

:

"indices":  [ 0, 0, 0, ... ],
"vertices": [ 0, 1, 2,  3, 4, 5,  6, 7, 8,  ... ]

triangle 0: [ 0, 1, 2,  0, 1, 2,  0, 1, 2 ]

...

. , triangle 0 triangle.length, triangle 200 triangle 400.

+8

Source: https://habr.com/ru/post/1542609/


All Articles