recp / AssetKit

🎨 Modern 2D/3D - Importer • Exporter • Util - Library, also known as (AssetIO)
Apache License 2.0
188 stars 18 forks source link

Investigate other ways to convertring multi-index array to single-index array #6

Closed recp closed 7 years ago

recp commented 7 years ago

Currently I'm duplicating positions for different input values for same position. For instance consider a CUBE; cube has 8 unique positions, and 24 normals. So we have single INDEX/ELEMENT ARRAY in GL.

Assume that COLLADA gives two different index for describe POSITION and NORMAL indices e.g.: 1 0 2 0 3 0 1 1 4 1 2 1 ...

During parsing I'm converting this indices (<p>) to: ( by duplicating positions ) 1 2 3 4 5 6 ...

In the end, I'm making 8 positions to 24 then send GPU,

Maybe there are better way to do this?