Matrix4: Don't require all inputs for decompose() or add other way to extract position
See original GitHub issueI often find myself getting the world position of an object via object.matrixWorld.decompose(position, quaternion, scale)
, without any need to get the quaternion or scale. However, not passing in a valid quaternion/euler or scale results in an error.
Would it be possible ignore undefined parameters with something like the following pseudo code?
if (position) {
calculate and set position;
}
if (quaternion) {
calculate and set quaternion;
}
if (scale) {
calculate and set scale;
}
Alternatively, could a extractPosition()
function and maybe a extractScale()
function be added to go along with extractRotation()
?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Decomposing a Matrix4 does not result in the same scale as ...
Create a random Quaternion for rotation. Compose a Matrix4 with the above inputs. Decompose this same matrix to other scale, rotation and ...
Read more >Matrix4#decompose – three.js docs
Matrix4. A class representing a 4x4 matrix. The most common use of a 4x4 ... decompose can be used to extract position, rotation...
Read more >How to extract position, rotation and scale from matrix SVG
To decompose separately rotation and the skew you can check those examples: ... else scaleY = -scaleY // Renormalize matrix to remove scale....
Read more >How to Get World Position with the Decompose Matrix Utility ...
Sometimes you want to know the world rotation or translation position of an object instead of it's local position and use that to...
Read more >Math::Matrix4 class | Magnum C++ docs
This function is a counterpart to rotation() const that does not require orthogonal input. See also rotationScaling() and scaling() const for extracting other...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can use these
Vector3
methods:Added to the docs in #18767