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

suggestion: implement colors #16

Open
dlabz opened this issue Feb 23, 2016 · 0 comments · May be fixed by #17
Open

suggestion: implement colors #16

dlabz opened this issue Feb 23, 2016 · 0 comments · May be fixed by #17

Comments

@dlabz
Copy link
Contributor

dlabz commented Feb 23, 2016

as @aothms suggested in another thread, there is a fairly simple way to implement colors.
It would require to change the output format a bit, though.

First step would be to use geometryData.getMaterialIndices to split the vertex stream of an object in parts with same material, and export each piece as a separate geometry.

ThreeJS handles geometry without indices quite fine, so index stream can be omitted. On a side note, I see no reason why each triangle is exported two times in the current version.

Second step would be to change the "objects" part of the stream, so that it can support segmented objects. The easiest way would be to attach them as children to the Mesh3D objects, and assign individual materials. Each material can be accessed from the 'geometryData.getMaterials'. I'm guessing stream is four float values per material (RGBA).

@antarktikali antarktikali linked a pull request May 27, 2016 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant