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

Prevent normalizing zero vector #5010

Closed
wants to merge 1 commit into from
Closed

Prevent normalizing zero vector #5010

wants to merge 1 commit into from

Conversation

lilleyse
Copy link
Contributor

GeometryPipeline.computeNormal is used by gltf-pipeline and will fail on some models when generating normals. This just checks if the normal is zero before trying to normalize. Maybe not the best fix, but definitely the easiest.

Some more discussion here: #4863 (comment)

@hpinkos
Copy link
Contributor

hpinkos commented Feb 15, 2017

Shouldn't we try to figure out why there are vertices where the normal is being computed as zero? It seems like this would only happen if the vertex isn't actually being used in the mesh. The whole reason we added this 'don't normalize the zero vector' developer error is to more easily detect invalid values coming in, so I don't think working around it like this is a good way to go about it.

@pjcozzi
Copy link
Contributor

pjcozzi commented Feb 16, 2017

Does the model have degenerate triangles?

@lilleyse
Copy link
Contributor Author

Yes most likely.

@pjcozzi
Copy link
Contributor

pjcozzi commented Feb 16, 2017

Wouldn't we be better off with a stage that removes degenerate triangles in gltf-pipeline?

@lilleyse
Copy link
Contributor Author

Yes I'm thinking that's best as well.

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 this pull request may close these issues.

3 participants