-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
LWOLoader: Fix coordinate system conversion. #28029
Conversation
fix: IFFParser.js now reads x as -x instead of z to -z. This now sets the geometry and pivot points in the correct location. This fixes mrdoob#26733
…nd lights and cameras
If your version of the screenshot still shows a diff, I'll generate the screenshot on my side after a merge. The reflections on the spheres are different because of the new transformation so we need a new screenshot in any event. In any event, make sure to install the latest dev dependencies before generating the screenshot. |
Side note: This is a breaking change since all apps using |
I actually installed the dependencies especially for making the screenshot. |
Related issue: #26733
Description
fix: IFFParser.js now reads x as -x instead of z to -z. This now sets the geometry and pivot points in the correct location.
It seems the original comments in this file were correct, in stating switching the 'x', but the file was committed with the z being flipped instead.
Now with the z being drawn in the correct direction, code like
lookAt
works correctly (which is +z based) and the pivot points no longer need double negating to have the geometry drawn in the correct location (except still had a -z problem)This fix now means no dirty hacks need to be post-applied after loading of the model.
A playground using this correction
This example shows both the minor fix from this PR, and also what exists in
r163
.I am not a massive fan of having to break things out into variables, but it was either that or
and I thought this would get more complaints.
I flipped the coordinates in webgl_loader_lwo.html file to match the removal of
-z
and addition of-x
I generated a new screenshot because even though they look identical to the human eye (except the grid helper) it seems 0.7% difference was too much to pass.