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

Mesh with colored vertices component #4

Open
bhowes-tt opened this issue Nov 4, 2014 · 2 comments
Open

Mesh with colored vertices component #4

bhowes-tt opened this issue Nov 4, 2014 · 2 comments
Milestone

Comments

@bhowes-tt
Copy link
Contributor

Take a mesh with color data (and optional attribute names and values) and output a json representation of the mesh and a list of all necessary materials for the compiler to consume.

@bhowes-tt bhowes-tt modified the milestone: 0.2.0 Nov 4, 2014
bhowes-tt added a commit that referenced this issue Nov 4, 2014
Updated to visual studio 2013.  Blocked out new components and edited
some of the existing components.  Some general clean up.  Addresses
issues #1, #2, #3, #4
@bhowes-tt
Copy link
Contributor Author

I don't think I'll be able to sort his out for 0.2. The component is blocked out and populates a [colors] array on the mesh object ... but this isn't enough for the json parser.

Option 1 - We hack it ourselves on the viewer side by looping over the geometry after it is parsed (and the json containing the color data that was ignored) and in the scene and populating face vertex colors based on the mesh's colors array (this is the road I went down ... felt sloppy and I never really got it to work).

Option 2- we figure out how to assign vertex colors using the three.json 3 rules for face data. See here: https://github.com/mrdoob/three.js/wiki/JSON-Model-format-3 It looks like we can assign vertex colors, face colors, and materials (as well as quads) by setting a type. We have always just been setting 0 ... which is a triangle. I don't know if I forgot that from the hackathon or just never knew ... but the Three.js json loader is set up to test for these types. This seems like the robust solution.

@bhowes-tt bhowes-tt removed this from the 0.2.0 milestone Nov 13, 2014
@theo-armour
Copy link
Member

See my response to issue #3

#3

On Thu, Nov 13, 2014 at 12:06 PM, Ben Howes notifications@github.com
wrote:

I don't think I'll be able to sort his out for 0.2. The component is
blocked out and populates a [colors] array on the mesh object ... but this
isn't enough for the json parser.

Option 1 - We hack it ourselves on the viewer side by looping over the
geometry after it is parsed (and the json containing the color data that
was ignored) and in the scene and populating face vertex colors based on
the mesh's colors array (this is the road I went down ... felt sloppy and I
never really got it to work).

Option 2- we figure out how to assign vertex colors using the three.json 3
rules for face data. See here:
https://github.com/mrdoob/three.js/wiki/JSON-Model-format-3 It looks like
we can assign vertex colors, face colors, and materials (as well as quads)
by setting a type. We have always just been setting 0 ... which is a
triangle. I don't know if I forgot that from the hackathon or just never
knew ... but the Three.js json loader is set up to test for these types.
This seems like the robust solution.


Reply to this email directly or view it on GitHub
#4 (comment).

@bhowes-tt bhowes-tt modified the milestone: 0.3.0 Nov 16, 2014
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

2 participants