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

Added configuration for computing vertex normals on JSON model loader. #163

Closed
wants to merge 1 commit into from

Conversation

RSpace
Copy link
Contributor

@RSpace RSpace commented Jul 26, 2017

This allows some models to get a much "smoother" look.

This allows some models to get a much "smoother" look.
@donmccurdy
Copy link
Collaborator

What do you think about making a small standalone component? This seems useful, but isn't specific to any one format.

For example something like:

AFRAME.registerComponent('mesh-smooth', {
  init: function () {
    this.el.addEventListener('model-loaded', function (e) {
      e.detail.model.traverse((function (node) {
        if (node.isMesh) node.geometry.computeVertexNormals();
      });
    }
  }
});

... then this would work for any file format, too.

@RSpace
Copy link
Contributor Author

RSpace commented Jul 27, 2017

That's a good idea. As part of aframe-extras or a separate repo on my own account?

@donmccurdy
Copy link
Collaborator

Up to you! I'd take a PR, probably in the misc folder, or feel free to start a repo. :)

Actually I just ran into a use case for this with a glTF model, too.

@RSpace
Copy link
Contributor Author

RSpace commented Aug 9, 2017

Finally got around to this: #165

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.

2 participants