-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
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
Matrix4: Add note about non-uniform scale to decompose(). #20752
Conversation
Thanks! |
Decomposes this matrix into it's [page:Vector3 position], [page:Quaternion quaternion] and | ||
[page:Vector3 scale] components. | ||
Decomposes this matrix into it's [page:Vector3 position], [page:Quaternion quaternion] and [page:Vector3 scale] components. | ||
The method can't be used to decompose an object's world matrix if its parent has a non-uniform scale. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That statement is incorrect. You can't make such general statements based on a specific example.
It is better to say nothing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be a better description? Or do you think that it's better to not say anything and let users figure it out on their own?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't make such general statements
TBH, I do not have the impression that it's a general statement. It's a specific note intended for Object3D.matrixWorld
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mugen87 As I said, the statement is not true.
A simple counterexample is a non-uniformly scaled parent matrix with a child having the Identity as its matrix. The child's world matrix is decomposable in that case. There are infinitely many other examples.
@mrdoob I would say nothing. If you insist on saying something, you could say "Note: not all matrices can be decomposed in this manner."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit of a delay but we finally got to discuss the statement "off-line".
@WestLangley suggested this one which I find educative:
Note: Not all matrices are decomposable in this way. For example, if an object has a non-uniformly scaled parent, then the object's world matrix may not be decomposable, and this method may not be appropriate.
I'll update the file directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related issue: Fixed #20435.
Description
The PR adds a note about non-uniform scale to
.decompose()
.