Much easier, as you do not need to calculate:
Place an object in the editor (scenario editor is perfect as the object is inside the tile of the folder scenery inside the scenario).
Set the angle by which you want to rotate. Rotate the object (e.g. Headlight).
Save the scenario.
Decompile the scenery tile with serz.
Search for "cFarMatrix" inside the xml. You will find something like this:
<Height d:type="sFloat32" d:alt_encoding="0000008071E95F40" d:precision="string">127.648</Height>
- Code: Select all
<RXAxis d:numElements="4" d:elementType="sFloat32" d:precision="string">0.9659258 -0.2588190 0.0000000 0.0000000</RXAxis>
<RYAxis d:numElements="4" d:elementType="sFloat32" d:precision="string">0.2588190 0.9659258 0.0000000 0.0000000</RYAxis>
<RZAxis d:numElements="4" d:elementType="sFloat32" d:precision="string">-0.0000000 0.0000000 1.0000000 0.0000000</RZAxis>
Just copy the values in your blueprint, line by line :
- Code: Select all
<Matrix>
<cHcRMatrix4x4>
<Element>
<e d:type="sFloat32">0.9659258</e>
<e d:type="sFloat32">-0.258819</e>
<e d:type="sFloat32">0</e>
<e d:type="sFloat32">0</e>
<e d:type="sFloat32">0.258819</e>
<e d:type="sFloat32">0.9659258</e>
<e d:type="sFloat32">0</e>
<e d:type="sFloat32">0</e>
<e d:type="sFloat32">0</e>
<e d:type="sFloat32">0</e>
<e d:type="sFloat32">1</e>
<e d:type="sFloat32">0</e>
<e d:type="sFloat32">0.4</e>
<e d:type="sFloat32">0.12</e>
<e d:type="sFloat32">-0.36</e>
<e d:type="sFloat32">1</e>
</Element>
</cHcRMatrix4x4>
This rotates your child 15° to the right.
Positioning here is 0.4m to the right, 0.12m forward and 0.36m down.