XML:OBAN: Difference between revisions

995 bytes added ,  6 January 2024
m
replaced matrix GIF with Math markup; had to change guide colors to suit what's available with Math's Tex implementation
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.


[[Image:rotation_of_transform_matrix.png|right|thumb|single rotation matrices]]
{| 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:#F77">1 0 0</span> <span style="background-color:#7F7">0 0.5    0.8660254</span> <span style="background-color:#77F">0 -0.8660254 0.5</span>    <font style="color:#AAAAAA">0 0 0</font></InitialTransform>
  <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:#F77">1 0 0</span> <span style="background-color:#7F7">0 cos(x) sin(x)</span>    <span style="background-color:#77F">0 -sin(x)    cos(x)<span>
                   <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:#FF7">0.5    0 -0.8660254</span> <span style="background-color:#F7F">0 1 0</span> <span style="background-color:#7FF">0.8660254 0 0.5</span>    <font style="color:#AAAAAA">0 0 0</font></InitialTransform>
{| style="float:right;"
                   <span style="background-color:#FF7">cos(y) 0 -sin(y)</span>    <span style="background-color:#F7F">0 1 0</span> <span style="background-color:#7FF">sin(y)    0 cos(y)</span>
|-
|<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:#777">0.5    0.8660254 0</span> <span style="background-color:#AAA">-0.8660254 0.5    0</span> <span style="background-color:#DDD">0 0 1</span> <font style="color:#AAAAAA">0 0 0</font></InitialTransform>
{| style="float:right;"
                   <span style="background-color:#777">cos(z) sin(z)    0</span> <span style="background-color:#AAA">-sin(z)    cos(z) 0</span> <span style="background-color:#DDD">0 0 1</span>
|-
|<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;"