Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store texture as map? #165

Open
pkarasev3-tri opened this issue May 14, 2019 · 2 comments
Open

Store texture as map? #165

pkarasev3-tri opened this issue May 14, 2019 · 2 comments

Comments

@pkarasev3-tri
Copy link

std::vector<Texture> textures;

The "TODO" in glview.cc seems difficult/impossible unless the textures are stored as an associated container... should the definition of Model be given maps instead of vectors for some cases?
tinygltf/examples/glview/glview.cc:424

@Ybalrid
Copy link
Contributor

Ybalrid commented May 14, 2019

In a glTF asset, everything is actually stored as arrays.

Material refer to texture as their index in the "texture" array. This kind of storage makes sense for tinygltf. Same goes for a texture source, it's an image.

Exactly the same for accessing all the binary data. Node -> Mesh -> accessor(s) -> bufferView -> buffer.

Each of these "->" is just an index in the corresponding array.

Hope this helps!

@Ybalrid
Copy link
Contributor

Ybalrid commented May 19, 2019

@pkarasev3-tri which "TODO" are you referring to exactly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants