Skip to content

Commit

Permalink
Merge pull request #18767 from sam6321/matrix4-extract-docs
Browse files Browse the repository at this point in the history
Docs: Added section on extracting position, rotation and scale from a Matrix4.
  • Loading branch information
mrdoob authored Feb 28, 2020
2 parents e3c55f8 + 904c396 commit 790811d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/api/en/math/Matrix4.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,24 @@ <h2>A Note on Row-Major and Column-Major Ordering</h2>
code, you'll have to take the [link:https://en.wikipedia.org/wiki/Transpose transpose] of any matrices outlined here to make sense of the calculations.
</p>

<h2>Extracting position, rotation and scale</h2>
<p>
There are several options available for extracting position, rotation and scale from a Matrix4.
<ul>
<li>
[page:Vector3.setFromMatrixPosition]: can be used to extract the translation component.
</li>
<li>
[page:Vector3.setFromMatrixScale]: can be used to extract the scale component.
</li>
<li>
[page:Quaternion.setFromRotationMatrix], [page:Euler.setFromRotationMatrix] or [page:.extractRotation extractRotation] can be used to extract the rotation component.
</li>
<li>
[page:.decompose decompose] can be used to extract position, rotation and scale all at once.
</li>
</ul>
</p>

<h2>Constructor</h2>

Expand Down
18 changes: 18 additions & 0 deletions docs/api/zh/math/Matrix4.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ <h2>注意行优先列优先的顺序。</h2>
请记住,如果您正在阅读源代码,您必须对这里列出的任何矩阵进行转置[link:https://en.wikipedia.org/wiki/Transpose transpose],以理解计算。
</p>

<h2>Extracting position, rotation and scale</h2>
<p>
There are several options available for extracting position, rotation and scale from a Matrix4.
<ul>
<li>
[page:Vector3.setFromMatrixPosition]: can be used to extract the translation component.
</li>
<li>
[page:Vector3.setFromMatrixScale]: can be used to extract the scale component.
</li>
<li>
[page:Quaternion.setFromRotationMatrix], [page:Euler.setFromRotationMatrix] or [page:.extractRotation extractRotation] can be used to extract the rotation component.
</li>
<li>
[page:.decompose decompose] can be used to extract position, rotation and scale all at once.
</li>
</ul>
</p>

<h2>构造器(Constructor)</h2>

Expand Down

0 comments on commit 790811d

Please sign in to comment.