<a name="l1"></a><a href="/Wb/Kernel/KernelA.HH#l3599"><span class=cF4>CDC</span></a><span class=cF0>'s have a 4x4 matrix for rotating, scaling, skewing and shifting in 3
<a name="l2"></a>dimensions. To make the graphics routines use the transform, you must set the </span><span class=cF4>
<a name="l5"></a>The matrix consists of ints that have been scaled 32 bits (</span><a href="/Wb/Adam/Gr/GrDC.HC#l4"><span class=cF4>GR_SCALE</span></a><span class=cF0>). See </span><span class=cF4>
<a name="l6"></a></span><a href="/Wb/Demo/Lectures/FixedPoint.HC#l1"><span class=cF4>::/Demo/Lectures/FixedPoint.HC</span></a><span class=cF0> to learn why.
<a name="l9"></a></span><a href="/Wb/Adam/Gr/GrMath.HC#l113"><span class=cF4>Mat4x4RotX</span></a><span class=cF0>(), </span><a href="/Wb/Adam/Gr/GrMath.HC#l127"><span class=cF4>Mat4x4RotY</span></a><span class=cF0>(), </span><a href="/Wb/Adam/Gr/GrMath.HC#l141"><span class=cF4>Mat4x4RotZ</span></a><span class=cF0>() and </span><a href="/Wb/Adam/Gr/GrMath.HC#l155"><span class=cF4>Mat4x4Scale</span></a><span class=cF0>() to rotate about axes
<a name="l10"></a>and scale. Combine them with </span><a href="/Wb/Adam/Gr/GrMath.HC#l80"><span class=cF4>Mat4x4MulMat4x4Equ</span></a><span class=cF0>()/</span><a href="/Wb/Adam/Gr/GrMath.HC#l96"><span class=cF4>Mat4x4MulMat4x4New</span></a><span class=cF0>() and
<a name="l11"></a>assign them to the </span><a href="/Wb/Kernel/KernelA.HH#l3599"><span class=cF4>CDC</span></a><span class=cF0>.</span><span class=cF2>dc</span><span class=cF0> with </span><a href="/Wb/Adam/Gr/GrDC.HC#l47"><span class=cF4>DCMat4x4Set</span></a><span class=cF0>(). See </span><a href="/Wb/Demo/Graphics/Box.HC#l1"><span class=cF4>::/Demo/Graphics/Box.HC</span></a><span class=cF0>.
<a name="l12"></a>
<a name="l13"></a>You can rotate single points using </span><a href="/Wb/Adam/Gr/GrDC.HC#l6"><span class=cF4>Mat4x4MulXYZ</span></a><span class=cF0>().
<a name="l14"></a>
<a name="l15"></a>The 4th dimension allows a neat trick where you can place pos shifts
<a name="l16"></a>(translations), into the matrix and </span><a href="/Wb/Adam/Gr/GrMath.HC#l80"><span class=cF4>Mat4x4MulMat4x4Equ</span></a><span class=cF0>/</span><a href="/Wb/Adam/Gr/GrMath.HC#l96"><span class=cF4>Mat4x4MulMat4x4New</span></a><span class=cF0> them
<a name="l18"></a>operations. See </span><a href="/Wb/Adam/Gr/GrMath.HC#l176"><span class=cF4>Mat4x4TranslationEqu</span></a><span class=cF0>() and </span><a href="/Wb/Demo/Graphics/Transform.HC#l1"><span class=cF4>::/Demo/Graphics/Transform.HC</span></a><span class=cF0>.
<a name="l19"></a>
<a name="l20"></a>Finally, </span><a href="/Wb/Kernel/KernelA.HH#l3599"><span class=cF4>CDC</span></a><span class=cF0>'s have an </span><span class=cF2>x</span><span class=cF0>, </span><span class=cF2>y</span><span class=cF0> and </span><span class=cF2>z</span><span class=cF0> which is an additional shift (translation).
<a name="l21"></a>
<a name="l22"></a>The transformation is implemented as a callback on the </span><a href="/Wb/Kernel/KernelA.HH#l3599"><span class=cF4>CDC</span></a><span class=cF0>'s </span><span class=cF2>transform()</span><span class=cF0> member.
<a name="l23"></a> The default </span><span class=cF2>transform()</span><span class=cF0> callback is </span><a href="/Wb/Adam/Gr/GrDC.HC#l15"><span class=cF4>DCTransform</span></a><span class=cF0>(). See </span><span class=cF4>
<a name="l24"></a></span><a href="/Wb/Demo/Games/Talons.HC#l1"><span class=cF4>::/Demo/Games/Talons.HC</span></a><span class=cF0> or </span><a href="/Wb/Demo/Games/CastleFrankenstein.HC#l1"><span class=cF4>::/Demo/Games/CastleFrankenstein.HC</span></a><span class=cF0> to see how to
<a name="l25"></a>change the </span><span class=cF2>transform()</span><span class=cF0> callback for foreshortening.