<aname="l1"></a><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l4261"><spanclass=cF4>CDC</span></a><spanclass=cF0>'s have a 4x4 matrix for rotating, scaling, skewing and shifting in 3 dimensions. To make the graphics routines use the
<aname="l2"></a>transform, you must set the </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l4232"><spanclass=cF4>DCF_TRANSFORMATION</span></a><spanclass=cF0> flag.
<aname="l4"></a>The matrix consists of ints that have been scaled 32 bits (</span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrDC.CC.html#l4"><spanclass=cF4>GR_SCALE</span></a><spanclass=cF0>). See </span><ahref="https://tomawezome.github.io/ZealOS/Demo/Lectures/FixedPoint.CC.html#l1"><spanclass=cF4>::/Demo/Lectures/FixedPoint.CC</span></a><spanclass=cF0> to learn why.
<aname="l6"></a>See </span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrDC.CC.html#l27"><spanclass=cF4>Mat4x4IdentEqu</span></a><spanclass=cF0>(), </span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrDC.CC.html#l38"><spanclass=cF4>Mat4x4IdentNew</span></a><spanclass=cF0>(), </span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrMath.CC.html#l130"><spanclass=cF4>Mat4x4Equ</span></a><spanclass=cF0>() and </span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrMath.CC.html#l137"><spanclass=cF4>Mat4x4New</span></a><spanclass=cF0>(). See </span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrMath.CC.html#l142"><spanclass=cF4>Mat4x4RotX</span></a><spanclass=cF0>(), </span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrMath.CC.html#l158"><spanclass=cF4>Mat4x4RotY</span></a><spanclass=cF0>(), </span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrMath.CC.html#l174"><spanclass=cF4>Mat4x4RotZ</span></a><spanclass=cF0>() and </span><spanclass=cF4>
<aname="l7"></a></span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrMath.CC.html#l190"><spanclass=cF4>Mat4x4Scale</span></a><spanclass=cF0>() to rotate about axes and scale. Combine them with </span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrMath.CC.html#l104"><spanclass=cF4>Mat4x4MulMat4x4Equ</span></a><spanclass=cF0>()/</span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrMath.CC.html#l124"><spanclass=cF4>Mat4x4MulMat4x4New</span></a><spanclass=cF0>() and assign them to
<aname="l8"></a>the </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l4261"><spanclass=cF4>CDC</span></a><spanclass=cF0>.</span><spanclass=cF2>dc</span><spanclass=cF0> with </span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrDC.CC.html#l51"><spanclass=cF4>DCMat4x4Set</span></a><spanclass=cF0>(). See </span><ahref="https://tomawezome.github.io/ZealOS/Demo/Graphics/Box.CC.html#l1"><spanclass=cF4>::/Demo/Graphics/Box.CC</span></a><spanclass=cF0>.
<aname="l10"></a>You can rotate single points using </span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrDC.CC.html#l6"><spanclass=cF4>Mat4x4MulXYZ</span></a><spanclass=cF0>().
<aname="l12"></a>The 4th dimension allows a neat trick where you can place pos shifts (translations), into the matrix and </span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrMath.CC.html#l104"><spanclass=cF4>Mat4x4MulMat4x4Equ</span></a><spanclass=cF0>/</span><spanclass=cF4>
<aname="l13"></a></span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrMath.CC.html#l124"><spanclass=cF4>Mat4x4MulMat4x4New</span></a><spanclass=cF0> them to combine rotation/shift operations. Normally, you can't combine pos shift operations. See </span><spanclass=cF4>
<aname="l14"></a></span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrMath.CC.html#l216"><spanclass=cF4>Mat4x4TranslationEqu</span></a><spanclass=cF0>() and </span><ahref="https://tomawezome.github.io/ZealOS/Demo/Graphics/Transform.CC.html#l1"><spanclass=cF4>::/Demo/Graphics/Transform.CC</span></a><spanclass=cF0>.
<aname="l16"></a>Finally, </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l4261"><spanclass=cF4>CDC</span></a><spanclass=cF0>'s have an </span><spanclass=cF2>x</span><spanclass=cF0>, </span><spanclass=cF2>y</span><spanclass=cF0> and </span><spanclass=cF2>z</span><spanclass=cF0> which is an additional shift (translation).
<aname="l18"></a>The transformation is implemented as a callback on the </span><ahref="https://tomawezome.github.io/ZealOS/Kernel/KernelA.HH.html#l4261"><spanclass=cF4>CDC</span></a><spanclass=cF0>'s </span><spanclass=cF2>transform()</span><spanclass=cF0> member. The default </span><spanclass=cF2>transform()</span><spanclass=cF0> callback is </span><spanclass=cF4>
<aname="l19"></a></span><ahref="https://tomawezome.github.io/ZealOS/System/Gr/GrDC.CC.html#l18"><spanclass=cF4>DCTransform</span></a><spanclass=cF0>(). See </span><ahref="https://tomawezome.github.io/ZealOS/Demo/Games/Talons.CC.html#l1"><spanclass=cF4>::/Demo/Games/Talons.CC</span></a><spanclass=cF0> or </span><ahref="https://tomawezome.github.io/ZealOS/Demo/Games/CastleFrankenstein.CC.html#l1"><spanclass=cF4>::/Demo/Games/CastleFrankenstein.CC</span></a><spanclass=cF0> to see how to change the </span><spanclass=cF2>transform()</span><spanclass=cF0> callback