Skip to content

suggestion: implement colors #16

Description

@dlabz

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).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions