18,700
edits
m (link fix) |
m (replaced matrix GIF with Math markup; had to change guide colors to suit what's available with Math's Tex implementation) |
||
Line 162: | Line 162: | ||
In some scenarios we need to build a new transform matrix, e.g. when making a new weapon particle emitter. The first 9 values belong to a 3x3 rotation matrix. The last 3 values are the start positions. | In some scenarios we need to build a new transform matrix, e.g. when making a new weapon particle emitter. The first 9 values belong to a 3x3 rotation matrix. The last 3 values are the start positions. | ||
{| style="float:right;" | |||
!Single rotation matrices | |||
|- | |||
|<math>R_x(\theta)=\begin{bmatrix} | |||
\color{Salmon}1 & \color{YellowGreen}0 & \color{CornflowerBlue}0 \\ | |||
\color{Salmon}0 & \color{YellowGreen}\cos\theta & \color{CornflowerBlue}-\sin\theta \\ | |||
\color{Salmon}0 & \color{YellowGreen}\sin\theta & \color{CornflowerBlue}\cos\theta\end{bmatrix} | |||
</math> | |||
|} | |||
x = 60 | x = 60 | ||
<InitialTransform><span style="background-color:# | <InitialTransform><span style="background-color:#F69289">1 0 0</span> <span style="background-color:#98CC70">0 0.5 0.8660254</span> <span style="background-color:#41B0E4">0 -0.8660254 0.5</span> <font style="color:#AAAAAA">0 0 0</font></InitialTransform> | ||
<span style="background-color:# | <span style="background-color:#F69289">1 0 0</span> <span style="background-color:#98CC70">0 cos(x) sin(x)</span> <span style="background-color:#41B0E4">0 -sin(x) cos(x)<span> | ||
y = 60 | y = 60 | ||
<InitialTransform><span style="background-color:# | {| style="float:right;" | ||
<span style="background-color:# | |- | ||
|<math>R_x(\theta)=\begin{bmatrix} | |||
\color{YellowOrange}\cos\theta & \color{SpringGreen}0 & \color{ProcessBlue}\sin\theta \\ | |||
\color{YellowOrange}0 & \color{SpringGreen}1 & \color{ProcessBlue}0 \\ | |||
\color{YellowOrange}-\sin\theta & \color{SpringGreen}0 & \color{ProcessBlue}\cos\theta\end{bmatrix} | |||
</math> | |||
|} | |||
<InitialTransform><span style="background-color:#FAA21A">0.5 0 -0.8660254</span> <span style="background-color:#C6DC67">0 1 0</span> <span style="background-color:#00B0F0">0.8660254 0 0.5</span> <font style="color:#AAAAAA">0 0 0</font></InitialTransform> | |||
<span style="background-color:#FAA21A">cos(y) 0 -sin(y)</span> <span style="background-color:#C6DC67">0 1 0</span> <span style="background-color:#00B0F0">sin(y) 0 cos(y)</span> | |||
z = 60 | z = 60 | ||
<InitialTransform><span style="background-color:# | {| style="float:right;" | ||
<span style="background-color:# | |- | ||
|<math>R_x(\theta)=\begin{bmatrix} | |||
\color{OrangeRed}1 & \color{SeaGreen}0 & \color{RoyalBlue}0 \\ | |||
\color{OrangeRed}0 & \color{SeaGreen}\cos\theta & \color{RoyalBlue}-\sin\theta \\ | |||
\color{OrangeRed}0 & \color{SeaGreen}\sin\theta & \color{RoyalBlue}\cos\theta\end{bmatrix} | |||
</math> | |||
|} | |||
<InitialTransform><span style="background-color:#ED135A">0.5 0.8660254 0</span> <span style="background-color:#3FBC9D">-0.8660254 0.5 0</span> <span style="background-color:#0071BC">0 0 1</span> <font style="color:#AAAAAA">0 0 0</font></InitialTransform> | |||
<span style="background-color:#ED135A">cos(z) sin(z) 0</span> <span style="background-color:#3FBC9D">-sin(z) cos(z) 0</span> <span style="background-color:#0071BC">0 0 1</span> | |||
{| class="wikitable" style="float:right;" | {| class="wikitable" style="float:right;" |