Graphics/Math

BSpline2 Funct Go in 2nd order spline calling callback. BSpline3 Funct Go in 3rd order spline calling callback. Bezier2 Funct Go in 2nd order bezier calling callback. Bezier3 Funct Go in 3rd order bezier calling callback. Circle Funct Step through circle arc calling callback. ClipLine Funct Clip x1,y1 x2,y2 with left,top,right,bottom. Ellipse Funct Step through ellipse arc calling callback. Line Funct Step through line segment calling callback. RegPoly Funct Step through regular polygon calling callback. gr_x_offsets GlbVar I64 gr_x_offsets[8]= {-1, 0, 1,-1,1,-1,0,1}, gr_x_offsets2 GlbVar gr_x_offsets2[4]= { 0,-1, 1, 0}, gr_y_offsets GlbVar gr_y_offsets[8]= {-1,-1,-1, 0,0, 1,1,1}, gr_y_offsets2 GlbVar gr_y_offsets2[4]= {-1, 0, 0, 1};

Graphics/Math/3D Transformation

CDC's have a 4x4 matrix for rotating, scaling, skewing and shifting in 3 dimensions. To make the graphics routines use the transform, you must set the DCF_TRANSFORMATION flag. The matrix consists of ints that have been scaled 32 bits (GR_SCALE). See ::/Demo/Lectures/FixedPoint.HC to learn why. See Mat4x4IdentEqu(), Mat4x4IdentNew(), Mat4x4Equ() and Mat4x4New(). See Mat4x4RotX(), Mat4x4RotY(), Mat4x4RotZ() and Mat4x4Scale() to rotate about axes and scale. Combine them with Mat4x4MulMat4x4Equ()/Mat4x4MulMat4x4New() and assign them to the CDC.dc with DCMat4x4Set(). See ::/Demo/Graphics/Box.HC. You can rotate single points using Mat4x4MulXYZ(). The 4th dimension allows a neat trick where you can place pos shifts (translations), into the matrix and Mat4x4MulMat4x4Equ/Mat4x4MulMat4x4New them to combine rotation/shift operations. Normally, you can't combine pos shift operations. See Mat4x4TranslationEqu() and ::/Demo/Graphics/Transform.HC. Finally, CDC's have an x, y and z which is an additional shift (translation). The transformation is implemented as a callback on the CDC's transform() member. The default transform() callback is DCTransform(). See ::/Demo/Games/Talons.HC or ::/Demo/Games/CastleFrankenstein.HC to see how to change the transform() callback for foreshortening. DCMat4x4Set Funct Set device context rot matrix. Will be Free in DCDel.Uses fixed-point. DCReflect Funct Reflect 3D point about device context's symmetry. Uses fixed-point. DCReflectOld Funct Reflect 3D point about device context's symmetry. Uses fixed-point. DCSymmetry3Set Funct 3D. Set device context's symmetry. DCSymmetrySet Funct 2D. Set device context's symmetry. DCThickScale Funct Scale device context's thick by norm of transformation. DCTransform Funct This is the dft dc->transform() callback. DCTransformOld Funct This is the dft dc->transform() callback. Mat4x4Equ Funct Copy 4x4 Rot matrix. Mat4x4IdentEqu Funct Set matrix to identity. Uses fixed-point. Mat4x4IdentNew Funct MAlloc an identity matrix. Uses fixed-point. Mat4x4MulMat4x4Equ Funct Multiply 4x4 matrices and store in dst. Uses fixed-point. Mat4x4MulMat4x4New Funct Multiply 4x4 matrices. Return MAlloced matrix. Uses fixed-point. Mat4x4MulXYZ Funct Rotate 3D point using 4x4 matrix. Uses fixed-point. Mat4x4New Funct Return MAlloced copy of 4x4 Rot matrix. Mat4x4NormSqr65536 Funct Norm Squared of r. Mat4x4Print Funct Print a 4x4 matrix Mat4x4RotX Funct Rot matrix about X axis. Uses fixed-point. Mat4x4RotXOld Funct Rot matrix about X axis. Uses fixed-point. Mat4x4RotY Funct Rot matrix about Y axis. Uses fixed-point. Mat4x4RotZ Funct Rot matrix about Z axis. Uses fixed-point. Mat4x4RotZOld Funct Rot matrix about Z axis. Uses fixed-point. Mat4x4Scale Funct Scale 4x4 matrix by value. Mat4x4TranslationAddFunct Add translation to 4x4 matrix. Uses fixed-point. Mat4x4TranslationEquFunct Set translation values in 4x4 matrix. Uses fixed-point. PopUpTransform Funct Prompt for Mat4x4 transform. SpriteTransform Funct Rotate Sprite using 4x4 matrix. Uses fixed-point.