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

envmap_vertex: Corrected calculation of world normal #7251

Merged
merged 1 commit into from
Sep 28, 2015

Conversation

WestLangley
Copy link
Collaborator

We can't apply an arbitrary matrix to transform a normal -- we have to use the normal matrix.

The normal matrix for transforms into camera space is available, but the normal matrix for transforms into world space is not.

The solution is to transform the normal to camera space, and then back to world space using (the inverse of) the view matrix, which is available.

This error was only evident for non-uniformly-scaled meshes rendered with MeshBasicMaterial or MeshLambertMaterial that also have an environment map.

No wonder.

@mrdoob
Copy link
Owner

mrdoob commented Sep 28, 2015

Is this related to #7111?

mrdoob added a commit that referenced this pull request Sep 28, 2015
envmap_vertex: Corrected calculation of world normal
@mrdoob mrdoob merged commit 1a06e79 into mrdoob:dev Sep 28, 2015
@WestLangley
Copy link
Collaborator Author

Is this related to #7111?

I doubt it.

@WestLangley WestLangley deleted the dev-world_normal branch September 28, 2015 01:57
@mrdoob
Copy link
Owner

mrdoob commented Sep 28, 2015

I bet it's something similar...

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