LWOLoader: Fix coordinate system conversion. #28029
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.